/* Program: bool.c A program using boolean variables. */ #include #include "genlib.h" #include "simpio.h" /* To use the string library functions: */ #include "strlib.h" main() { bool service, shoes, shirt ; string s ; printf("Are you wearing shoes? ") ; s = GetLine() ; shoes = StringEqual(s,"Yes") || StringEqual(s,"yes"); printf("Are you wearing a shirt? ") ; s = GetLine() ; shirt = StringEqual(s,"Yes") || StringEqual(s,"yes"); service = shirt && shoes ; if (service) printf("Please come in.\n") ; else printf("Please leave the premises.\n") ; }