Question: For compare.c program, there is something wrong with the program. Your task is to find out how to change the string the user enters to

For compare.c program, there is something wrong with the program. Your task is to find out how to change the string the user enters to lowercase so that it will match the definition at the top in all lowercase. You can fix anything that you feel wrong.

For compare.c program, there is something wrong with the program. Your task

1 compare.c - this will work / #include 3 #include // declares strcmp() 5 #define ANSWER "Grant" 6 #define SIZE 40 7 char s gets (char st, int n)i 9 void compare (void) 10 char trySIZE 12 puts ("Who is buried in Grant's tomb?") s gets(try, SIZE) while (strcmp(try, ANSWER) 0) 14 15 16 17 18 19 20 puts "No, that's wrong. Try again."); s gets(try, SIZE) puts ("That's right!"; 23 24 char s gets (char st, int n) 25 26 char ret val; inti- 28 ret val -fgets (st, n, stdin) if (ret val) 31 1++i if (stli)'n' 35 else // must have words[i]1e 37 38 while (getcharO -'n') continue; 40 41 42 return ret val

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!