Applicants must be 18 to 60 years old. What does the program print for age 70, and why?
#include <stdio.h>
int main(void) {
int age = 70;
if (age >= 18 || age <= 60)
puts("eligible");
else
puts("not eligible");
return 0;
}
70 ≥ 18, so the whole || is true. A range needs both bounds: &&. Compilers often warn that such overlapping comparisons are always true.