🎙 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 10 of 15

In the copy loop while ((d++ = s++) != '\0');, when does the loop stop?

In the copy loop while ((*d++ = *s++) != '\0');, when does the loop stop?

  1. A.Before copying the '\0'
  2. B.Right after copying the '\0'
  3. C.After a fixed 100 characters
  4. D.It never stops
Answer & explanation

Correct answer: Right after copying the '\0'

The assignment copies the character first, then the test sees it was '\0' and stops — so the copy is properly ended.

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 →