import java.io.*;
class Fact
{
public static void main(String args[])throws IOException
{
int a = 1,n,i;
System.out.print("Enter The Number Whoes Factorial Is To Be Found : ");
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
n = Integer.parseInt(br.readLine());
for(i=n;i>0;i--)
{
a = a * i;
}
System.out.println("Factorial of "+n +" is "+a);
}
}
/*********** OUTPUT **********
Enter The Number Whoes Factorial Is To Be Found : 5
Factorial of 5 is 120 */
0 comments:
Post a Comment