C++ Strings Quiz - Question 10

Last Updated :
Discuss
Comments

What will be the output of the following code?

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

int main() {
    string str = "Hello";
    str.pop_back();
    cout << str;
    return 0;
}

Hello

Hell

ello

Helo

Share your thoughts in the comments
Article Tags :