diff options
Diffstat (limited to 'Master/texmf-dist/doc/latex/pygmentex/Factorial.java')
-rw-r--r-- | Master/texmf-dist/doc/latex/pygmentex/Factorial.java | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/Master/texmf-dist/doc/latex/pygmentex/Factorial.java b/Master/texmf-dist/doc/latex/pygmentex/Factorial.java new file mode 100644 index 00000000000..aea3cb5c8c3 --- /dev/null +++ b/Master/texmf-dist/doc/latex/pygmentex/Factorial.java @@ -0,0 +1,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); + } +} |