Computer Science, asked by kalikantroy27, 4 months ago

In Java

Write a program to input a number and display its factorial.​

Answers

Answered by saimaqadir314
0

Answer:

solve with your own

Write a Java program to find the factorial of a given number

Let's see the factorial Program using loop in java.

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

Similar questions