Examveda

What will be the output of the following C++ code?
#include <iostream>
#include <string>
using namespace std;
int main ()
{
    string str="Steve Jobs founded the apple";
    string str2 = str.substr (6, 4);
    unsigned pos = str.find("the");
    string str3 = str.substr (pos);
    cout << str2 << ' ' << str3 << '\n';
    return 0;
}

A. Jobs the apple

B. the apple

C. Steve

D. Jobs

Answer: Option A


Join The Discussion

Related Questions on Arrays and Strings in C plus plus