WHAT'S NEW?

Factorial Program

Factorial Program

class Factorial 
{
public static void main(String[] args) 
{
int counter,number=5,factorial=1;

for (counter=1;counter<=number ;counter++ )
{
factorial=factorial*counter;
}
System.out.println("Factorial of "+number+" is : "+factorial);
}

}

0 comments:

Post a comment