Files
oop/labs/lab1_done/DividerApp/Program.cs
2025-09-30 08:21:09 +03:00

29 lines
742 B
C#

using System;
class DivideIt
{
public static void Main(string[] args)
{
try
{
Console.WriteLine("enter the first integer");
string temp = Console.ReadLine();
int i = Int32.Parse(temp);
Console.WriteLine("enter the second integer");
temp = Console.ReadLine();
int j = Int32.Parse(temp);
int k = i / j;
Console.WriteLine("{0} / {1} = {2}", i, j, k);
}
catch (FormatException e)
{
Console.WriteLine("format exception was thrown: {0}", e.Message);
}
catch (Exception e)
{
Console.WriteLine("exception was thrown: {0}", e.Message);
}
}
}