🎙 Free live masterclass · Sun, 29 Nov, 7:00 pm IST · Java Full Stack roadmap Register free →
Skills101
← Quiz: String Handling in C: all 15 questions

Quiz: String Handling in C · Question 3 of 15

strcmp("apple", "apply") returns:

strcmp("apple", "apply") returns:

  1. A.0
  2. B.A negative value
  3. C.A positive value
  4. D.The length of the common part
Answer & explanation

Correct answer: A negative value

The first difference is 'e' vs 'y'; 'e' is smaller, so the result is negative.

Can you get the rest right without peeking?

Take the timed Quiz: String Handling in C quiz free. Pass it to earn XP and count towards your certificate.

Start the quiz →