Question: Write a C program to read strings from the user until the program reads the END string. For each string, use the C program to

Write a C program to read strings from the user until the program reads the "END" string. For each string, use the C program to change the lowercase letters (a to z) to upper case letters (A to Z) and change the uppercase letters to lowercase letters. The program should output the changed strings to the screen. Hint: (i) You can use fgets() to read a string. After read the string, you can use strcmp(str, "END ") or strcmp(str, "END") (determined by your platform) to judge whether the input string is "END", where " " is the new line character read by the fgets() function. (ii) For a lowercase character "ch", use "ch - 32" to get its uppercase letter. For a uppercase letter "ch", use "ch + 32" to get its lowercase letter (iii) You can assume that the maximum length of the input string is 1024. (iv) You can use a for loop from 0 to "strlen(string)" to iterate all the characters in the string. (v) For a character "ch", you can use 'a'
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
