import java.util.*;
class factorial
{
public static void fact(int n)
{
int i=0,f=1;
for(i=1;i<=n;++i)
f=f*i;
System.out.println(f);
}
public static void main()
{
Scanner in=new Scanner(System.in);
System.out.println(“Enter a number to find its factorial”);
int inp=in.nextInt();
fact(inp);
}
}
In this post we ave discussed about how to make a java program to find and print the factorial of a number.The program requires a number as an input to find its factorial and print it.he factorial of a number is the product if all all its digits.
THANKS FOR VISITING AND READING OUR BLOG .FOR MORE PROGRAMS REGULARLY CHECK OUR BLOG.
THANK YOU !!!!!!!!
Making money as a coder in 2025 is not much of a big or tough…
Lloyds Technology Centre, A tech and data company located in Hyderabad, India. They are part of…
How to Increase Height at Any Age Rise Above: How to Increase Height at Any…
In the fast-paced digital world, we often forget the timeless beauty that nature offers. Today,…
Top 10 Deadliest Kicks in Martial Arts: Master the Art of Knockouts Martial arts is…
How to Optimize Battery Life of Your Smartphone: Tips and Tricks for Prolonging Battery Health…
View Comments
Id like to thank you for the efforts youve put in writing this blog. I am hoping to check out the same high-grade content by you later on as well. In truth, your creative writing abilities has motivated me to get my own, personal website now ;)