Computer Science, asked by asinghal611, 1 year ago

Write a java program to find no of the factorial.Here, no is to be find not the factorial.eg if 120 is given as no.its factorial is 5.

Answers

Answered by Priyanka429
0
Hey Friend !!☺
Here is your answer,

=》import java. util.*;
class Factorial
{
public static void main()
{
Scanner sc= newScanner (System.in);
int i, n, f=1;
System. out.Println ("Enter anumber ");
n=sc.nextInt ();
for (i=1;i <=n;i++)
{
f=f*i;
}
System. out.Println (" Factorial is " + f);
}
}

_________________________

I hope it helps
Thank you

asinghal611: hii priyanka..
asinghal611: in this we have to find number....not factorial..example input is 125 and ouput is 5...please help me..
Similar questions