Home > Google > What is Convert.ToInt32(Console.ReadLine()) Method In C#

What is Convert.ToInt32(Console.ReadLine()) Method In C#

October 28th, 2007

The method Console.ReadLine always 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.ToInt32 does this.

Example Code:-

Console.WriteLine("Please enter a number");
int Num = Convert.ToInt32(Console.ReadLine());

Google

  1. March 8th, 2008 at 17:12 | #1

    Console.Write(“\nfor Example: “);
    for (t = 0; t

  1. No trackbacks yet.