0
c#
how to get input/values from user in c#?
3 Answers
+ 10
Console.ReadLine()
For integer đ
Convert.ToInt32(Console.ReadLine())
check this đfor more
https://www.sololearn.com/learn/CSharp/2585/?ref=app
+ 4
well , depending on what you need from the user , if you want to store the user input in string variable just do the following :
string var = Console.ReadLine();
notice that by default every input from the user will be string type. so lets say you want to take An integer value from the user , you will need to convert the string value like this :
int var = Convert.ToInt32(Console.ReadLine());
0
thanks both of you...