0 votes
in Other by

Write a code to find the factorial?

1 Answer

0 votes
by

class Factorial{   public static void main(String args[]){    int i, fact=1;    int number=5;     for(i=1; i<=number; i++){          fact=fact*i;      }      System.out.println("Factorial of "+number+" is "+fact);     }  }

...