C++ Strings Quiz - Question 6

Last Updated :
Discuss
Comments

What will be the output of the following code?

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

int main() {
    string str1 = "Hello";
    string str2 = "World";
    string str3 = str1 + " " + str2;
    cout << str3;
    return 0;
}

HelloWorld

Hello World

Hello

Hello " " World

Share your thoughts in the comments
Article Tags :