What will be the output of the following C++ code if the string entered by the user is “Hello World”?
Posted: Wed Jul 13, 2022 7:52 pm
#include <iostream>
#include <string>
using namespace std;
int main(int argc, char const *argv[])
{
string str;
cin>>str;
cout<<str;
return 0;
}
a) Hello World
b) Hello
c) World
d) Error
#include <string>
using namespace std;
int main(int argc, char const *argv[])
{
string str;
cin>>str;
cout<<str;
return 0;
}
a) Hello World
b) Hello
c) World
d) Error