Factorial Of A Number

No Comment - Post a comment

/********** Factorial Of A Number **********/

class Factorial
{
public static void main(String args[])
{
int a = 5;
int fact = a;
for(int i=a-1;i>=1;i--)
fact = fact * i;
System.out.println("Factorial : "+ fact);
}
}

/********** OUTPUT ***********
Factorial : 120 */

 
This Post has No Comment Add your own!

Post a Comment