Sample Problem
•
What does this code snippet print:
•
•
int foo( int x );
•
•
int main()
•
{
•
foo(-2);
•
•
return 0;
•
}
•
•
int foo( int y )
•
{
•
if ( y < 4 )
•
{
•
cout << y << “ “;
•
y = foo( y + 1);
•
}
•
cout << y << “ “;
•
return y;
•
}
•
•
-2 -1 0 1 2 3 4 4 4 4 4 4 4