1
visibility

Predict the output ?
int c = (3<4)? 3*4:3+4;

  • 3

  • 12

  • 4

  • Error

As 3 is less than 4 so condition of ternary operator is true. Variable c is assigned the value of expression 1 which is 3 * 4 = 12.