Practice mode C Language

What value does strlen(“hello”) return in C?

Correct answer C. 5

Explanation

strlen() counts the characters before the terminating null character. The string "hello" has five characters, so it returns 5; the null terminator is not counted.

Report a problem

Answer checked How we write and check questions

Tip: press A, B, C or D to answer, and N for the next question.

Advertisement

Have a question about this answer?

Your email address will not be published. Required fields are marked *

Links and website addresses are not allowed in comments.