0

How to correctly take an input from the user? Please write a code how to take a string input and int input. Thank you very much!

26th Oct 2016, 3:35 PM
UnknownCayon
2 Réponses
+ 1
Use Console.ReadLine(); Which will be used to get the string i/p from user. To get int input, use the same command and covert the string to int. For eg. int num = Convert.ToInt32(Console.ReadLine()); Please note that there mightbe some syntax issue. Hope it will be helpful to you
26th Oct 2016, 4:07 PM
Venkatesh(Venki)
Venkatesh(Venki) - avatar
0
It depends on your program type: console app, win forms, etc
26th Oct 2016, 9:22 PM
Ivan G
Ivan G - avatar