What will be the output of the following C++ code?
#include <iostream>
#include <string>
using namespace std;
int main(int argc, char const *argv[])
{
string s1 = "Hello";
string s2 = "World";
string s3 = s1 + " " + s2;
cout<<s3;
return 0;
}
#include <iostream>
#include <string>
using namespace std;
int main(int argc, char const *argv[])
{
string s1 = "Hello";
string s2 = "World";
string s3 = s1 + " " + s2;
cout<<s3;
return 0;
}A. Hello World
B. Hello
C. World
D. Error
Answer: Option A

Join The Discussion