Apple Interview Question

Write a function that calculates a number's factorial using recursion

Interview Answer

Anonymous

Dec 18, 2010

function factorial ( N ) return N * (( N > 1 ) ? factorial ( N - 1) : 1) ;