int i=2,j=2; int a=(i+1?--i:j++); cout<<a; | SoloLearn: Learn to code for FREE!

+1

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

answer for this code is 1...why?

10/28/2017 8:08:42 AM

Omkar P

2 Answers

New Answer

+20

since i+1==3!=0 [true] it returns --i==i-1==1...

+1

i=2,j=2 @ValentinaHacker