using System;
using System.Collections.Generic;
using System.Text;
namespaceConsoleApplication5
{
classProgram
{
staticvoidMain(string[] args)
{
int x, y, z = 0;
try
{
Console.WriteLine("Enter The Value of X");
x = Convert.ToInt32(Console.ReadLine());
Console.WriteLine("Enter The Value of Y");
y = Convert.ToInt32(Console.ReadLine());
z = x / y;
}
catch (Exception ex)
{
Console.WriteLine(ex);
}
finally
{
Console.WriteLine("The Division is : " + z);
}
}
}
}
Note:- you can manipulate this code as per requirement.
Ashutosh Chaturvedi87 pointsPosted Apr 25, 2013, 5:06 AM EDT
using System; using System.Collections.Generic; using System.Text; namespace ConsoleApplication5 { class Program { static void Main(string[] args) { int x, y, z = 0; try { Console.WriteLine("Enter The Value of X"); x = Convert.ToInt32(Console.ReadLine()); Console.WriteLine("Enter The Value of Y"); y = Convert.ToInt32(Console.ReadLine()); z = x / y; } catch (Exception ex) { Console.WriteLine(ex); } finally { Console.WriteLine("The Division is : " + z); } } } }Note:- you can manipulate this code as per requirement.