Factorial of a number – Java program

Factorial of a number :

Factorial of a number n is given by n! .
Formula is n!=n*(n-1)*(n-2)*…..*2*1

Source Code :

Here is a source code to find the factorial of a number in Java :

Sample Output :

Enter the number
5
Factorial of 5 is: 120

Leave a Reply

Your email address will not be published. Required fields are marked *