long factorial(long n) { // returns n! if (n <= 1) return 1; // 0! = 1! = 1 else return n * factorial(n-1); // n! = n * (n-1)! }