-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathFunctions.java
42 lines (35 loc) · 1.1 KB
/
Functions.java
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.*;
public class Functions {
// public static void printMyName(String name){
// System.out.println(name);
// return;
// }
// public static void main(String[] args) {
// Scanner sc=new Scanner(System.in);
// String name=sc.next();
// printMyName(name);//call funtction
// }
// public static int calculateSum(int a, int b){
// int sum=a+b;
// return sum;
// }
// public static void main(String[] args) {
// Scanner sc=new Scanner(System.in);
// int a=sc.nextInt();
// int b=sc.nextInt();
// int sum=calculateSum(a,b);
// System.out.print("sum of a and b: "+sum);
// }
public static void printFactorial(int n){
int fact=1;
for(int i=n;i>=1;i--){
fact=fact*i;
}
System.out.println(fact);
return fact;
}
public static void main(String[] args) {
Scanner sc= new Scanner(System.in);
int n=sc.nextInt();
}
}