0

When a = 3 and b=2; we have a++ =4 , b= a ++ = 4, and now ++b should be 5 or 4 ?

25th Mar 2017, 2:11 PM
Mohammed Merbout
6 Answers
+ 9
5
25th Mar 2017, 2:16 PM
J.G.
J.G. - avatar
+ 7
This is what I understand: int a = 3, b= 2; //b is two b = a = 4; //b is four ++b; //b is five cout << b; //five is outputted You wouldn't assign a value to an increment operator. b = a++ might be what You were looking for. Tell me if that is what you meant and I will help you.
26th Mar 2017, 11:50 AM
J.G.
J.G. - avatar
0
5 because b contains 4 and increment it by 1.
25th Mar 2017, 2:25 PM
Mayur Chaudhari
Mayur Chaudhari - avatar
0
this app says ++b = 4
26th Mar 2017, 5:44 AM
Mohammed Merbout
0
int a =3, b = 2; b= a++; cout >> ++b;
27th Mar 2017, 11:49 AM
Mohammed Merbout
0
?????
27th Mar 2017, 11:49 AM
Mohammed Merbout