We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 0df2613 commit 0998f13Copy full SHA for 0998f13
Faktoriyel.java
@@ -0,0 +1,21 @@
1
+package com.company;
2
+
3
+import java.util.Scanner;
4
5
+public class Faktoriyel {
6
+ public static void main(String args[]){
7
+ Scanner scanner = new Scanner(System.in);
8
+ System.out.print("Sayı Giriniz: ");
9
+ int sayi = scanner.nextInt();
10
+ int faktoriyel = faktoriyel(sayi);
11
+ System.out.println(sayi+"! = "+faktoriyel);
12
+ }
13
14
+ public static int faktoriyel(int sayi){
15
+ int carpim =1;
16
+ for(int i = 1; i < sayi+1; i++){
17
+ carpim = carpim*i;
18
19
+ return carpim;
20
21
+}
0 commit comments