What value does strlen return for the string literal "hello"?
-
A
4
-
B
7
-
C
5
Correct answer
-
D
6
14 views
Explanation
strlen counts the characters before the terminating null, so five is returned.
Reference
Asked in: NTS, PPSC IT, Campus Interviews
Doubts & discussion
Not sure why the answer is C? Ask here and get an explanation.
Ask a doubt about this MCQ