← All topics
Quiz: String Handling in C: questions with answers
15 questions, each with the answer and a short explanation.
Take the timed quiz + get a certificate →- Q1. What does this print? (code)
- Q2. What is wrong with char s = "hello"; s[0] = 'H';?
- Q3. strcmp("apple", "apply") returns:
- Q4. What does this print? (code)
- Q5. Why is snprintf preferred over sprintf?
- Q6. After this code, what is in csv? (code)
- Q7. Why is strtol safer than atoi for converting text to a number?
- Q8. What does this print? (code)
- Q9. Which statement about strtok is true?
- Q10. In the copy loop while ((d++ = s++) != '\0');, when does the loop stop?
- Q11. What does this print? (code)
- Q12. What does this print? (code)
- Q13. What does this print? (code)
- Q14. For char a[] = "hi";, what is sizeof(a)?
- Q15. What does this print? (code)