Factorial Program
- class FactorialExample{
- public static void main(String args[]){
- int i,fact=1;
- int number=5;//It is the number to calculate factorial
- for(i=1;i<=number;i++){
- fact=fact*i;
- }
- System.out.println("Factorial of "+number+" is: "+fact);
- }
- }
Sir can u give me the output of program
ReplyDelete5 is 120
DeleteCan u please explain the factorial program once
ReplyDeleteCan you please explain the out put
ReplyDeleteCan you please explain the factorial program
ReplyDelete