Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

MySQL/PHP Database Applications

Authors: Jay Greenspan, Brad Bulger

1st Edition

ISBN: 978-0764535376

More Books

Students also viewed these Databases questions

Question

Develop skills for building positive relationships.

Answered: 1 week ago

Question

Describe techniques for resolving conflicts.

Answered: 1 week ago

Question

Give feedback effectively and receive it appropriately.

Answered: 1 week ago