Calculate factorial of a number(using java)

 // factorial of a number

5!=  5*4*3*2*1      =120

class factorial

{

public static void main(String args[])

{

int no=10,fact=1;

for(int i=1; i<=no ; i++)

{

fact=fact*i;

}

System.out.println(fact);

}}



Comments

Popular posts from this blog