Example of conditional operator
total = (total > MAX) ? total + 1 : total + 2;
is equivalent to:
if (total > MAX)
total = total + 1;
else
total = total + 2;
Previous slide
Next slide
Back to first slide
View graphic version