logo CodeStepByStep logo

valuesOfABC

Language/Type: C++ basics mystery variables

What are the values of a, b, and c after the following code statements? (It may help you to write down their values after each line.)

int a = 5;
int b = 10;
int c = b;
a = a + 1;
b = b - 1;
c = c + a;
a
b
c

You must log in before you can solve this problem.

Log In

Need help?

Stuck on an exercise? Contact your TA or instructor.

If something seems wrong with our site, please

Is there a problem? Contact us.