We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent c8c68ae commit 18f2814Copy full SHA for 18f2814
FaktoriyelRecursive.java
@@ -0,0 +1,21 @@
1
+package com.company;
2
+
3
+import java.util.Scanner;
4
5
+public class FaktoriyelRecursive {
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
+ if(sayi == 1){
16
+ return 1;
17
+ }else{
18
+ return sayi*faktoriyel(sayi-1);
19
20
21
+}
0 commit comments