a+ =a++ + ++b + ++a + b++ where a=8 and b=6 | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

a+ =a++ + ++b + ++a + b++ where a=8 and b=6

18th May 2018, 2:49 PM
Jelly Fan
Jelly Fan - avatar
4 Answers
+ 7
int a = 8; int b = 6; int c = ((a++)+(++b)+(++a)+(b++)); System.out.println(c); /* Output is 32. I think it looks like this, Im assuming that the increment that uses the value first increments straight after that value is used then when it reaches the next increment of the same variable a new increment is made which includes any previous increments. 😅 8+7+10+7 */
18th May 2018, 3:04 PM
D_Stark
D_Stark - avatar
+ 2
Such questions are useless because the behavior of multiple ++ operators is often not even defined and also makes the code quite unreadable
18th May 2018, 3:00 PM
Aaron Eberhardt
Aaron Eberhardt - avatar
+ 2
30
19th May 2018, 4:34 AM
V .MITHILA
V .MITHILA - avatar
0
Output=38
4th Dec 2018, 6:11 PM
Pratik
Pratik - avatar