Which condition is true for every int x?
Any x is either at least 18 or at most 60, so the || condition always holds – a common bug where && was meant. The first option can never be true.
Decision Making · Exercise 1 of 4
Twelve multiple-choice questions on truth values, De Morgan's laws, range checks, guard order, comparing strings and doubles, and choosing between if, switch and tables. Pick an option to check your answer instantly.
Which condition is true for every int x?
Any x is either at least 18 or at most 60, so the || condition always holds – a common bug where && was meant. The first option can never be true.
Is case 90 ... 100: valid standard C?
Standard C, C23 included, allows only single constant case labels. GCC and Clang accept ranges as an extension, and Clang with -pedantic-errors rejects them as "a C2y extension". For ranges, if-else is the portable tool.
Timed online tests with instant scores and explanations.