Answer:
Step-by-step explanation:
Given
The above code segment
Required
The final values of
The following line declares and initializes the values of a, b and c
int a = 1; int b = 0; int c = -1;
So, we have:
Next, the following if condition is tested
if ((b + 1) == a)
And:
So,
Since the condition is true, the statements in the curly brace { } will be executed;
So:
So:
Next, the following if condition is tested
c == a
c = 0 and a =1
So:
That means, the statements in its curly brace will not be executed.
So, the final values of a, b and c are: