0

what is the output and how?

int a=3; int b=2; b=a++; cout<<++b;

18th Dec 2017, 1:11 PM
Frankestine Stine
Frankestine Stine - avatar
1 Respuesta
+ 12
b = a++; // post increment This statement makes a = 4 and b = 3 cout << ++b; // pre increment b is now 4 and the term ++b is also 4 Output: 4 More details on pre and post increment: https://www.sololearn.com/discuss/407846/?ref=app
18th Dec 2017, 1:34 PM
Shamima Yasmin
Shamima Yasmin - avatar