Answers for "allintitle:Reverse factorial program in java"

1

Reverse factorial program in java

// Reverse factorial program in java
import java.util.Scanner;
public class ReverseFactorialProgram
{
   public static void main(String[] args)
   {
      Scanner sc = new Scanner(System.in);
      System.out.println("Please enter a number to compute reverse factorial: ");
      int number = sc.nextInt();
      int reverse = number;
      for(int a = 2; reverse != a; a++)
      {
         reverse = reverse / a;
      }
      System.out.println("Reverse factorial of " + number + " is: " + reverse);
      sc.close();
   }
}
Posted by: Guest on February-18-2021

Code answers related to "allintitle:Reverse factorial program in java"

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language