/* * Explanation of why the "!" operator has to be applied to the whole * condition. * Sara Sprenkle * CISC105 midterm.3.c * 07.11.2005 */ #include int main() { int a, b; printf("Enter two numbers: "); scanf("%d %d", &a, &b); if( ! (a >= 0 && a <= 20) && !(b >= 5 && b <= 10 ) ) { printf("Both in range\n"); } else { printf("Neither are in range\n"); } if( ! (a >= 0 && a <= 20 && b >= 5 && b <= 10 ) ) { printf("Both in range\n"); } else { printf("Neither are in range\n"); } return 0; }