using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ConsoleApplication36
{
class Program
{
static void Main(string[] args)
{
int a, b;
float c;
l1:
Console.WriteLine("Enter the value of a :");
a = int.Parse(Console.ReadLine());
Console.WriteLine("Enter the value of b :");
b = int.Parse(Console.ReadLine());
try
{
c =(float) (a *1.0 / b);
Console.WriteLine("value of c =" + c);
}
catch (Exception e)
{
Console.ForegroundColor = System.ConsoleColor.Red;
Console.WriteLine("Error is "+e);
}
finally
{
Console.ForegroundColor = System.ConsoleColor.White;
Console.WriteLine("press any key to continue.....");
Console.ReadKey();
Console.Clear();
}
goto l1;
}
}
}
No comments:
Post a Comment