Question PRG-CPP-0022
EasyWhat is the output of this program?
#include <iostream>
#include <string>
using namespace std;
int main() {
string s = "abc";
cout << s.size();
return 0;
}
- A.
4
- B.
2
- C.
Show answer and explanation
Answer: C
size() returns the number of characters in the string.