JAVA
java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
import java.util.*;
public class reverseFactorial
{
public static long factorial(long x)
{
long fact=1;
for(long i=x;i>=1;i--)
{
fact*=i;
}
return(fact);
}
public static void main(String[] args)
{
Scanner in= new Scanner(System.in);
long test=0,revFact=0,n,methodCaller;
System.out.println("Enter the number to test the reverse Factorial");
try
{
n=in.nextLong();
}
catch(Exception e)
{
System.out.println("Wanna Crash me\nGo and try to crash a plane, thats gotta be easier\nBut to give you a demo:");
n=120;
}
for(long j=1;j<=n;j++)
{
Enter to Rename, Shift+Enter to Preview
OUTPUT
Run