Create a function named factorial () which accept an integer number and print its factorial. Output will be as:
Answers
Answered by
0
class Fact
{
public void factorial(int n)
{
int i,f=1;
for(i=1;i<=n;i++)
{
f*=i;
}
System.out.println("Factorial is "+f);
}
public static void main()
{
Fact ob=new Fact();
ob.factorial(15);
}
}
Hope it will help you @
Ask if not got and follow me to answer your more java questions.
Mark me brainlest @
Similar questions
Hindi,
7 months ago
English,
7 months ago
Social Sciences,
1 year ago
English,
1 year ago
English,
1 year ago