using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace ConsoleApplication1
{
class Program
{
static void Main(string[] args)
{
int number;
try
{
//What you want to try!
Console.Write("Write a number: ");
number = Convert.ToInt32(Console.ReadLine());
}
catch (Exception ex)
{
Console.WriteLine(ex); //Writes Exception
}
}
}
}