public class FactorialWithoutUserInteraction
{
public static void main(String[] args)
{
int fact=1;
for(int i=1;i<=8;i++)
{
fact=fact*i;
}
System.out.println("\n Factorial of 8 is = "+fact);
}
}
Output:
Factorial of 8 is = 40320
Basic Java programs. All programs done in very simple ways. It helps beginners to grow their programming skills and build a programming logic.
Subscribe to:
Post Comments (Atom)

No comments:
Post a Comment
If you have any doubts, please let me know