Vidyalelo
C++ Programming · Q172

Classes and Objects in C++

Programming · C++ Programming · question 172

Q172

What will be the output of the following C++ code? #include #include using namespace std; int main () string str ("steve jobs is legend"); string::iterator it; str.erase (str.begin()+ 5, str.end()-7); cout << str << endl; return 0;

A.
jobs is
B.
steve legend
Answer
C.
steve
D.
steve jobs is

Answer: Option B

Solution

Answer: Option B
No explanation is given for this question Let's Discuss on Board