Home » C++ Programming » Strings » Question
  1. What is the output of this program?
    #include <iostream>
    #include <string>
    using namespace std;
    int main ()
    {
    string s ("Bjarne Stroustrup founded the C++");
    string s2 ("C++");
    unsigned found = s.find(s2);
    if (found != string :: npos)
    cout << found << '\n';
    return 0;
    }
    1. founded the C++
    2. Bjarne Stroustrup
    3. C++
    4. 30
    5. None of these
Correct Option: D

In this program, We are finding a string by using the find method.



Your comments will be displayed only after manual approval.