FDM Group Interview Question

What is recursion and can you explaining doing Factorial? static int factorial(int n){ your code goes here }

Interview Answer

Anonymous

Mar 22, 2024

Google recursion, my answer should have been something like this but I messed up. if (n == 0){ return 1 } else { return n * factorial(n) }