1public class Tester {
2 static int factorial(int n) {
3 if (n == 0)
4 return 1;
5 else
6 return (n * factorial(n - 1));
7 }
8 public static void main(String args[]) {
9 int i, fact = 1;
10 int number = 5;
11 fact = factorial(number);
12 System.out.println(number + "! = " + fact);
13 }
14}