Java

Factorial Program

Oct 4, 2013

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);
 }

}
 

Related Posts

language_img
Java

Methods

Oct 4, 2013

language_img
Java

Inner Classes

Oct 3, 2013

Table Of Contents

;