Factorial of Number - Java

import java.io.*;
class Factorial
{
public static void main(String [] args)
{
try
{
BufferedReader object= new BufferedReader(new InputStreamReader(System.in));
int num,i;
System.out.println("Enter the Number to Calculate the Factorial");
num=Integer.parseInt(object.readLine());
int factorial=1;
System.out.println("The FACTORIAL OF Number"+num+"is:");
for(i=1;i<=num;i++)
{
factorial=factorial*i;
}
System.out.println("The FACTORIAL is"+factorial);
}
catch(Exception e)
{
}
}
}

Popular posts from this blog

AGRICULTURAL SCIENTIST RECRUITMENT BOARD

HSC Exam Time Table 2013 Arts, Commerce, Science

CIVIL SERVICES' (I.A.S.) EXAMINATION