Why do all my codes prompt me for user input before the question has been displayed? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Why do all my codes prompt me for user input before the question has been displayed?

Whenever I am in the code playground and I have a Console.WriteLine command, e.g. "what is your name?", followed by a Console.ReadLine command, e.g. reading in the name, I am expecting that when I run the code, the written line will first be displayed followed by a chance for user input. However, instead when I run the code, it just says my code is expecting some input. How is the user to know it is their name they are meant to enter? The code then finishes running and Then displays the "what is your name" line, i.e. after it has been entered. Is there a way around this? Is this just a quirk of the app? Many thanks in advance

15th Apr 2020, 9:20 AM
O B
O B - avatar
3 Answers
15th Apr 2020, 9:21 AM
HonFu
HonFu - avatar
+ 1
Thank you HonFu ! That explained what is happening, but the solution was just to avoid asking for user input. So is there really no way around it? And does this apply outside the app also like in Visual Studio for example?
15th Apr 2020, 9:36 AM
O B
O B - avatar
+ 1
No, this is specific Sololearn, because code is not executed live here. You can take inputs, you just have to give them all *before* the code runs, separated by line, in that one pop up window.
15th Apr 2020, 10:04 AM
HonFu
HonFu - avatar