0

How to print multiple Output using ReadLine() in C#

I am definitely a beginner can someone help me thanks

13th Jul 2018, 1:46 AM
BHOUSZJINGJING
6 Answers
0
Console.ReadLine (); reads until the end of the line. If you want to take multiple lines of text call Console.ReadLine () for every line that you want to store. btw Console.ReadLine () returns the string that the user inputted after they hit enter.
13th Jul 2018, 4:07 AM
John
John - avatar
0
How about integers ? i want to input integers . Btw i am using Android phone only
13th Jul 2018, 10:38 AM
BHOUSZJINGJING
0
Thank you
13th Jul 2018, 10:43 AM
BHOUSZJINGJING
0
no problem, if you can could you mark my answer as the answer.
13th Jul 2018, 10:45 AM
John
John - avatar
0
I am a beginner and o want to pursue IT in college for now im busy in self study
13th Jul 2018, 10:47 AM
BHOUSZJINGJING
- 1
You can convert the output of console.readline to in integer. int number = int.parse(Console.ReadLine()); If you are to give that a non numerical value like a word: hello, for example that would throw an exception. For that you can try int.TryParse(string, out int number);
13th Jul 2018, 10:42 AM
John
John - avatar