0
Getting user input lesson
I would expect the question What is your name? to show up before I am requested to enter something. Instead I am requested to enter something. Afterwards the question and answer show up at the same time. Why does that happen?
2 Answers
+ 5
Thats notpossibe in Soloearn's playground.
Try other pc softwares
0
If it's on sololearns playground you need to enter input before it shows the output.
If it's on e.g. Code::Blocks (which I use), it works in that direction you make it.
Example on playgrounds:
//All the standard.
int main()
{
string name;
cout << "Hello, please enter your name";
cin >> name;
return 0;
}
It makes you input your name first.
If it's on e.g. Code::Blocks: It outputs:
Hello, please enter your name
//userinput