Google interview question

Write an algorithm to calculate n factorial

Interview Answer

Anonymous

4 Jul 2010

fact(int n) { if(n==0) return ; else return n*fact(n-1); }