/* * project4 * Chapter 4 * John Stile * Purpose: Write a program that asks the user for an uppoer case letter, * checks to see if the user did as instructed, * and then responds with the correesponding lower case letter.. */ #include // include functions in stdio.h int main(void) // header for main. take nothing, return int { char xx; // declare char variable xx printf("Please ender a lower case letter: "); // prompt user for an upper case letter scanf("%c", &xx); // read singl caracter and stor at memory location of xx // only allow letters if (xx<65 || xx>90) // if the value of the input is out of range of an upper case ASCII, { printf("That is not a lower case letter!\n"); // chastize the user and exit return 1; // return value of 1 to calling function } printf("The corresponding lower case letter is: %c \n", xx+32); // print the value of xx+32 and print as char return 0; // return a value of 0 to the calling function }