+ 1

int i=2,j=2; int a=(i+1?--i:j++); cout<<a;

answer for this code is 1...why?

28th Oct 2017, 8:08 AM
Omkar P
Omkar P - avatar
2 Respuestas
+ 20
since i+1==3!=0 [true] it returns --i==i-1==1...
28th Oct 2017, 8:22 AM
Valen.H. ~
Valen.H. ~ - avatar
+ 1
i=2,j=2 @ValentinaHacker
28th Oct 2017, 8:25 AM
Omkar P
Omkar P - avatar