/* The factorial of a positive integer n, denoted by n!, is the product of all positive integers less than or equal to n */
import java.util.*;
public class FACTORIAL
{
void Find()
{
Scanner in=new Scanner(System.in);
int N,f=1,i;
System.out.println("Enter a Number to find its Factorial");
N=in.nextInt();
for(i=1;i<=N;i++)
f=f*i;
System.out.println("The factorial of "+N+" is : "+f);
}
}
No comments:
Post a Comment