Question: The following piece of C code is taking a string input from the user and compares it with cmp1401. The given code has errors in

The following piece of C code is taking a string input from the user and compares it with "cmp1401". The given code has errors in certain lines. The numbers on the left indicate line numbers. From the given options, please select the one that contains the complete list of the erroneous lines. Hint: strlen(x) outputs the length (as an integer) of the input string x. 1 2 3 4 5 6 7 8 9 10 NH O 11 12 13 14 15 16 a. b. c. d. e. void compare (char a, int size) ( if ("cmp1401" = a) } printf("Correct!\ "); else } int main() { printf("Not correct!\ "); 1, 3, 12 1, 12, 14 3, 10, 12 3, 12 12, 14 char course [20]; printf("Enter course code: "); scanf("c", &course); printf("Length of course is: %d \ ", strlen(course)); compare (course, strlen (course)); return 0

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!