Since, to read a string value or to print a line, we use Console.ReadLine() - but, we can convert it into an integer value.
Syntax to convert string formatted value to integer:
integer_variable = Convert.ToInt32(Console.ReadLine());
Here, Convert is a class in C# and ToInt32() is a static member of it – which is used to convert a string value to the 4 bytes integer.
Program:
Output