Question PRG-CPP-0065
HardWhat is the output of this program?
#include <iostream>
#include <string>
#include <algorithm>
using namespace std;
int main() {
string s = "hello world";
reverse(s.begin(), s.begin() + 5);
cout << s << " " << count(s.begin(), s.end(), 'l');
return 0;
}
- A.
olleh world 3
- B.
hello world 3
- C.
Sign up free to see the answer and a step-by-step explanation.