-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcode.java
More file actions
14 lines (14 loc) · 464 Bytes
/
code.java
File metadata and controls
14 lines (14 loc) · 464 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
import java.util.Scanner;
public class code {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int t = Integer.parseInt(sc.nextLine());
for (int i = 0; i < t; i++) {
int n = Integer.parseInt(sc.nextLine());
int factorial = 1;
for (int j = 1; j <= n; j++)
factorial = factorial * j;
System.out.println(factorial);
}
}
}