0
This is ternary operator 1st condition is true i=0 and true value is 1 but why the output show 3 . Explain?
int i=0; cout<<(i=0?1:2?3:4);
3 Answers
+ 13
Since i=0.. comparison false.. then goes for 2
Comparison of 2 with 0 ..true hence prints 3
+ 2
Where its true i=0 and represent false next condition will check 2 non zero which will give result true so Output will be 3
0
đĄïžJasprit why check false condition?