Answers for "calculate Factorial java"

1

factorial number in java

int num1 = 6; 
 int num2 = 1;
    for(int a = 1; a<=num1; a++) {
        num2 = num2 * a;
    }
        System.out.println(num2);
Posted by: Guest on June-04-2021
1

factorial program in java

public class FactorialDemo
{
   public static void main(String[] args)
   {
      int number = 6, factorial = 1;
      for(int a = 1; a <= number; a++)
      {
         factorial = factorial * a;
      }
      System.out.println("Factorial of " + number + " is : " + factorial);
   }
}
Posted by: Guest on October-25-2020
1

factorial java

double factorial = 1;
double number=30;

while ( numero!=0) {
  factorial=factorial*number;
  number--;
}
Posted by: Guest on June-05-2021

Code answers related to "calculate Factorial java"

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language