Search⌘ K

Quick Quiz on Recursion with Numbers!

Quiz on recursion with numbers.

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 ...