Request Issue
No response
Website Section
No response
Proposal Details
import java.util.Scanner;
class Factorial{
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
System.out.print("Enter the number: ");
int n = sc.nextInt();
int fact = 1;
for(int i=1; i<=n; i++){
fact *= i;
}
System.out.println(fact);
sc.close();
}
}
Author References
No response
Request Issue
No response
Website Section
No response
Proposal Details
import java.util.Scanner;
class Factorial{
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
System.out.print("Enter the number: ");
int n = sc.nextInt();
int fact = 1;
for(int i=1; i<=n; i++){
fact *= i;
}
System.out.println(fact);
sc.close();
}
}
Author References
No response