We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 5083f9f commit e84ada1Copy full SHA for e84ada1
factorial using recursion
@@ -0,0 +1,27 @@
1
+import java.util.Scanner;
2
+public class practice {
3
+
4
+ public static int aj(int b)
5
+ {
6
+ if(b>=1) {
7
+ return b * aj(b - 1);
8
+ }
9
+ else
10
11
+ return 1;
12
13
14
15
+ public static void main(String[] args)
16
17
+ Scanner sc=new Scanner(System.in);
18
+ int a;
19
+ System.out.println("enter the number");
20
+ a=sc.nextInt();
21
+ int t=aj(a);
22
+ System.out.println(t);
23
24
25
26
27
0 commit comments