theme changed
This commit is contained in:
28
labs/lab1_done/DividerApp/Program.cs
Normal file
28
labs/lab1_done/DividerApp/Program.cs
Normal file
@@ -0,0 +1,28 @@
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user