if int a=3; So, a++; a = ? If int a = 3; So, a ++; a =?
Answers
Answered by
0
Given :
a = 3
b = 2
Then :
b = a++
which means take a value to b and then increment the a value. so b value is same as a (before the increment), so with that statement, their value become:
b = 3 (same as a before increment)
a = 4 (the value change because we got increment)
Then evaluate the last statement:
++b => this means that we increment the value before we use the value. so in the end.
so,
cout << ++b; // will result: 4.
MARK ME AS BRAINLIST ANSWER !!
Similar questions
Biology,
3 months ago
Math,
3 months ago
Physics,
7 months ago
English,
7 months ago
Social Sciences,
11 months ago