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 !!!!!!!!

Lavi Thakur

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 ;)

Recent Posts

How to make money as a Beginner Coder in 2025

Making money as a coder in 2025 is not much of a big or tough…

8 months ago

Lloyds Technology Centre : A Concise Guide

Lloyds Technology Centre, A tech and data company located in Hyderabad, India. They are  part of…

9 months ago

How to Increase Height at Any Age

How to Increase Height at Any Age Rise Above: How to Increase Height at Any…

10 months ago

The Hidden Beauty of Karrukha Wood: A Rare Masterpiece from Nature

In the fast-paced digital world, we often forget the timeless beauty that nature offers. Today,…

10 months ago

Top 10 Deadliest Kicks in Martial Arts [2024]

Top 10 Deadliest Kicks in Martial Arts: Master the Art of Knockouts Martial arts is…

11 months ago

How to Optimize Battery Life of Your Smartphone

How to Optimize Battery Life of Your Smartphone: Tips and Tricks for Prolonging Battery Health…

11 months ago