Question PRG-CPP-0071
HardWhat is the output of this program?
#include <iostream>
#include <string>
using namespace std;
int main() {
string a = "abc", b = "abd";
cout << (a < b) << (a.compare(b) < 0) << (a + b).substr(2, 3);
return 0;
}
- A.
01cab
- B.
10cab
- C.
Sign up free to see the answer and a step-by-step explanation.