Answers for "factorial program in java from 1 to 10"

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

Code answers related to "factorial program in java from 1 to 10"

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language