C++ Output Prediction Easy +10 XP
String Length
What does this output?
C++Read-only
string s = "Hello"; cout << s.length();
What is the output?
Show answer and explanation
Answer: 5
The string 'Hello' has 5 characters. length() returns the character count.
Hint: Count the characters.
What this challenge tests
Output Prediction in C++: strings, methods.