Computer Science, asked by oendrila, 1 year ago

How to find the factorial of a number by writing the programming in Java...

Answers

Answered by duragpalsingh
6
Hey there! ☺☻☺

Program to find the factorial of a number using Java:

Let assume the number whose factorial we need to find be 7.

Now Java programming:

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


Hope It Helps You! ☺☻☺

oendrila: Thanx..
Similar questions