/* File: if7.c Testing && and || */ #include int main() { char shoes, shirt, cr ; printf("No shoes, No shirt, No Service\n") ; printf("Are you wearing shoes? (y/n/Y/N) ") ; scanf("%c%c", &shoes, &cr) ; printf("Are you wearing a shirt? (y/n/Y/N) ") ; scanf("%c%c", &shirt, &cr) ; if ( (shoes == 'y' || shoes == 'Y') && (shirt == 'y' || shirt == 'Y') ) { printf("You are properly dressed, come in!\n") ; } else { printf("Please put on some decent clothes!\n") ; } return 0 ; }