Question: The following code reads a string from the keyboard and prints out a version with any uppercase characters converted to lowercase. However, it has a

The following code reads a string from the keyboard and prints out a version with any uppercase characters converted to lowercase. However, it has a flaw. Identify it and suggest a correction. #include #define MAX_LEN 10 char *LowerCase(char *s); int main(void) { char str[MAX_LEN]; printf("Enter a string: "); scanf("%s", str); printf("Lowercase: %s ", LowerCase(str)); return 0; } char *LowerCase(char *s) { char newStr[MAX_LEN]; int index; for(index = 0; index
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
