Quick Quiz on Recursion with Numbers!
Explore key recursion techniques applied to numeric problems such as factorial computation, Fibonacci numbers, and prime checks. This quiz helps reinforce your grasp on these concepts and prepares you for using recursion effectively in coding interviews.
We'll cover the following...
We'll cover the following...
Technical Quiz
1.
What is the output of the following code?
int foo(int n)
{
if (n == 12)
{
return n;
}
else
{
return foo(n+1);
}
}
int main()
{
cout<<foo(3);
return 0;
}
A.
75
B.
12
C.
3
1 / 2
Well done! You are ...