Double ternary operator

Report a typo

Based on the values of b1, b2, and b3, a different value will be stored in result.

int result = (b1 && b2) ? 10 : (b2 || b3) ? 20 : 30; 

The options below mention different values for the three boolean variables and the results they will return. Select only the correct options where the returned value matches the result from the code given above.

Select one or more options from the list

Create a free account to access the full topic