Question: Please trace the c++ program below #include using namespace std; int f (int a); int main() { cout return 0; } int f (int a)
Please trace the c++ program below
#include
using namespace std;
int f (int a);
int main()
{
cout
return 0;
}
int f (int a)
{
if (a==1 || a==2)
return (2);
else
return (f(a-1)+f(a-2));
}
the output is 42.
the tracing is use local and global variable as follows

Variable Scope Value Example: X Y Local: Main Function Local: The fx squared function Global 0 1 3
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
