OneCompiler

java program to find the factorial of a number N given by user.

132

import java.util.*;

public class HelloWorld {
public static void main(String[] args) {
Scanner sc=new Scanner(System.in);
int n=sc.nextInt();
int fact=1;
for(int i=1;i<=n;i++)
{
fact*=i;
}
System.out.println(fact);
}
}