c# | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

c#

how to get input/values from user in c#?

17th Apr 2018, 10:12 AM
Abdullah
Abdullah - avatar
3 Answers
+ 10
Console.ReadLine() For integer 👇 Convert.ToInt32(Console.ReadLine()) check this 👇for more https://www.sololearn.com/learn/CSharp/2585/?ref=app
17th Apr 2018, 10:17 AM
🌛DT🌜
🌛DT🌜 - avatar
+ 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());
17th Apr 2018, 1:05 PM
Ashraf Al_Absi
Ashraf Al_Absi - avatar
0
thanks both of you...
21st Apr 2018, 4:47 PM
Abdullah
Abdullah - avatar