title: How to read an integer using console.readline()?
body: <p>I'm a beginner who is learning .NET. </p>
  
  <p>I tried parsing my integer in console readline but it shows a format exception.</p>
  
  <p>My code:</p>
  
  <pre><code>using System;
  namespace inputoutput
  {
      class Program
      {        
          static void Main()
          {
              string firstname;
              string lastname;
           // int age = int.Parse(Console.ReadLine());
              int age = Convert.ToInt32(Console.ReadLine());
              firstname = Console.ReadLine();
              lastname=Console.ReadLine();
              Console.WriteLine("hello your firstname is {0} Your lastname is {1} Age: {2}",
                  firstname, lastname, age);
          }
      }
  }
  </code></pre>