/* Program to find Factorial of number */
class Demo
{
public static void main(String args[])
{
int fact=1;
for(int num=5;num>=1;num--)
{
fact*=num;
}
System.out.println("Factorial of 5 is :"+fact);
}
}
class Demo
{
public static void main(String args[])
{
int fact=1;
for(int num=5;num>=1;num--)
{
fact*=num;
}
System.out.println("Factorial of 5 is :"+fact);
}
}
0 comments:
Post a Comment