1. Home
  2. Computer Science MCQs
  3. C Programming
  4. What value does strlen return for the string literal…

Added 30 Nov -0001

What value does strlen return for the string literal "hello"?

  1. 4
  2. 7
  3. 5 Correct answer
  4. 6

Correct answer

C. 5

14 views

MCQSEXAM

Explanation

strlen counts the characters before the terminating null, so five is returned.

Reference

Asked in: NTS, PPSC IT, Campus Interviews

Preparing for an exam?

Doubts & discussion

Not sure why the answer is C? Ask here and get an explanation.

Ask a doubt about this MCQ

Shown after review. No links please.

More C Programming MCQs

Practise all C Programming MCQs

Similar MCQs