+ 1

Why can't I get the second input prompt?

namespace SoloLearn { class Program { static void Main(string[] args) { string yourName; string yourLand; Console.WriteLine("What is your name?"); yourName = Console.ReadLine(); Console.WriteLine("Hello {0}", yourName); Console.WriteLine("Where are you from?"); yourLand = Console.ReadLine(); Console.WriteLine("I'm from {0}", yourLand); } } }

23rd Nov 2016, 7:36 AM
Gamma Life
Gamma Life - avatar
3 ответов
+ 6
The online compiler is a little weird. You have to send all the inputs for the entire program at once before it runs. For this code, when you get the input box, you'd write the name on one line, and the location on the next. When sent and compiled, ReadLine() will take them one by one.
23rd Nov 2016, 7:44 AM
Tamra
Tamra - avatar
+ 3
i think sololearn uses batched input. when your program runs, write the values for each of your input statements on separate lines
23rd Nov 2016, 7:40 AM
asdadasdsaczxc
+ 1
Thanks Daniel/Thanks Tamra, That is pretty weird, and not the answer I expected lol.
23rd Nov 2016, 7:49 AM
Gamma Life
Gamma Life - avatar