

public class ex10
{
  public static long factorial(int x) 
  { 
  long faktoriyel=1; 
  for(int sayi=1;sayi<=x;sayi++) 
  { faktoriyel*=sayi;} 
  return faktoriyel; 
  }
 

 // main method begins execution of Java application
 public static void main( String args[] )
 {
 int x=5; 
 System.out.println(x+" factorial:" + factorial(x) ); 
 } // end method main

} // end class BPIH5E15
