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

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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!