/* File: if8.c A variation using nested if statements. */ #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) ; if ( shoes == 'y' || shoes == 'Y') { printf("Are you wearing a shirt? (y/n/Y/N) ") ; scanf("%c%c", &shirt, &cr) ; if ( shirt == 'y' || shirt == 'Y' ) { printf("You are properly dressed, come in!\n") ; } else { printf("Please put on a shirt of some kind!\n") ; } } else { printf("Please put on some shoes!\n") ; } return 0 ; }