FACTORIAL NUMBER IN JAVA // BLUEJ HUB
***************************************class FactorialExample
{
public static void main(String args[])
{
int i,fact=1; {
public static void main(String args[])
{
int number=5;
for(i=1;i<=number;i++)
{
fact=fact*i;
}
System.out.println("Factorial of "+number+" is: "+fact);
}
}
0 Comments