summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/pygmentex/Factorial.java
blob: aea3cb5c8c3aea788ed95d7fd07fbdfa4eeab2c9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
public class Factorial
{
   public static void main(String[] args)
   {
      int number = 5;
      int factorial = 1;
      for (int i = 1; i <= number; i++)
         factorial = factorial * i;
      System.out.println("Factorial of " + number +
                         " is " + factorial);
   }
}