String | Data Structure Quiz for Beginners | Question 2

Last Updated :
Discuss
Comments

What is the output of the following code?

C++
#include <iostream>
using namespace std;

int main()
{

    string str = "Hello";
    cout << str.substr(2, 5);
    return 0;
}

Syntax error

ello

llo

None

Share your thoughts in the comments