Your Ad Here

Friday, May 30, 2008

Exception Handling

/* Simple Example On Exception Handling. This program is just intended to give you an idea of how an exception is handled by your C# program. */

using System;
using System.Collections.Generic;
using System.Text;

namespace Program1
{
class Program
{
static void Main(string[] args)
{
double a;

try
{
Console.WriteLine(Enter A float Number);
a = Convert.ToDouble(Console.ReadLine());
}
catch (SystemException ex)
{
Console.WriteLine(ex);
}
}
}
}

No comments: