WAJP to create a function that accepts an integer and find and prints the factorial of integer.
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 !!!!!!!!
israelnightclub.com
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 😉