Wednesday, June 6, 2012


public int factorial(int n) {
        if (n == 0) return 1;
        else return (n * factorial(n-1));     // tail recursion

public int factorial(int n) {
        int product = 1;
        int i;
        for (i = n; i >= 1; i--)    
            product = i * product;            // without tail recursion
        return product;


Unknown said...

Hi, This is Chandrika from Chennai. I have read your blog and I got some knowledgeable information through this blog. Really useful blog. Keep update your blog.

Java Training in Chennai

WUGI said...

Tired of watching TV? Go to the BGAOC website and earn with us best slot machine games It’s hard to lose and make money with us. Come on BGAOC and get your winnings.