Question: I am having a hard time understanding this program. I dont understand why this program prints c as 4 instead of 5 on the first
I am having a hard time understanding this program.
I dont understand why this program prints c as 4 instead of 5 on the first cout statement.
I know a is 1 and b is 2 because when the recursion call ends those variable goes away.
A remains 1 because of the global variable, and b remains 2 due to the local B in main().
Also, I am having a hard time understanding why b and c are both 8 in the second cout statement?

Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
