28 Oct, 2007 · 1 minute read
The method Console.ReadLinealways reads the input from the user in the form of a string. To get an integer value from the user, this string needs to be converted to Integer. The Convert.ToInt32does this.
Example Code:-
Console.WriteLine("Please enter a number");
int Num = Convert.ToInt32(Console.ReadLine());