Ques 7 string quiz

ques 7 string quiz
why is answer only s.length() and why not s.size() also

As per the documentation of c++(https://en.cppreference.com/w/cpp/string/basic_string), these are just synonyms. size() is there to be consistent with other STL containers (like vector, map, etc.) and length() is to be consistent with most peoples’ intuitive notion of character strings. People usually talk about a word, sentence or paragraph’s length, not its size, so length() is there to make things more readable. So length length is often used with strings.