-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPrime.java
More file actions
42 lines (36 loc) · 941 Bytes
/
Prime.java
File metadata and controls
42 lines (36 loc) · 941 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
import java.util.Scanner;
public class Prime {
public static int fact(int n) {
if (n == 0)
return 1;
else if (n == 1)
return 1;
return n * fact(n - 1);
}}
/*public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int row = sc.nextInt();
// *
// * *
// * * *
// * * * *
for (int i = 0; i < row; i++) {
for (int j = 0; j <= i; j++) {
System.out.print("* ");
}
System.out.println();
}
}
}*/
//import java.util.*;
// public class Prime
// {
// public static void main(String args[])
// {
// Scanner sc = new Scanner(System.in);
// String s1=sc.nextLine();
// String s2=sc.nextLine();
// ntln("No");
// }
// }
// }