Opening Hours :7AM to 9PM
import java.util.Scanner; public class Factorial { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); System.out.print("Enter a number: "); int number = scanner.nextInt(); int factorial = 1; for (int i = 1; i <= number; i++) { factorial *= i; } System.out.println("The factorial of " + number + " is " + factorial); } }This program prompts the user to enter a number, reads it from the standard input, and calculates the factorial of the number using a simple loop. The result is then printed to the standard output.