Program to print the factorial of the entered number
import java.util.*;
import java.io.*;
import java.lang.*;
//Importing Packages
public class Fact //declaring class
{ //opening braces of class
public static void main(String[]args) //declaring main method
{ //opening braces of main method
Scanner pa = new Scanner(System.in); //declaring Scanner class
System.out.println("Enter the number you factorial of");
int n = pa.nextInt(); //Inputing number by user
int f=1;
for(int i=1;i<=n;i++)
{ //opening braces of loop
f=f*i;
} // closing braces of loop
System.out.println("Factorial of "+n+" is "+f); //Printing fatorial
} // closing braces of main method
} // closing braces of class
VARIABLE DATA TYPE FUNCTION
n Integer To store the number entered by the user
f Integer To store and print the factorial
i Integer To execute loop till entered terms