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?

I am having a hard time understanding this program. I dont understand

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!