using System;
namespace Calculation
{
class Calculate
{
int Bil1, Bil2;
char option;
int Result;
public void Number()
{
Console.WriteLine("Enter the First number");
Bil1 = Convert.ToInt32(Console.ReadLine());
Console.WriteLine("Enter the second number");
Bil2 = Convert.ToInt32(Console.ReadLine());
Console.WriteLine("Main Menu");
Console.WriteLine("1.Addition");
Console.WriteLine("2.Subtraction");
Console.WriteLine("3.Multiplication");
Console.WriteLine("4.Division");
Console.WriteLine("Enter the Operation you want to perform");
option = Convert.ToChar(Console.ReadLine());
switch (option)
{
case '1':
Result = Bil1 + Bil2;
Console.WriteLine("The result of addition is:{0}", Result);
break;
case '2':
namespace Calculation
{
class Calculate
{
int Bil1, Bil2;
char option;
int Result;
public void Number()
{
Console.WriteLine("Enter the First number");
Bil1 = Convert.ToInt32(Console.ReadLine());
Console.WriteLine("Enter the second number");
Bil2 = Convert.ToInt32(Console.ReadLine());
Console.WriteLine("Main Menu");
Console.WriteLine("1.Addition");
Console.WriteLine("2.Subtraction");
Console.WriteLine("3.Multiplication");
Console.WriteLine("4.Division");
Console.WriteLine("Enter the Operation you want to perform");
option = Convert.ToChar(Console.ReadLine());
switch (option)
{
case '1':
Result = Bil1 + Bil2;
Console.WriteLine("The result of addition is:{0}", Result);
break;
case '2':
Result = Bil1 - Bil2;
Console.WriteLine("The result of subtraction is:{0}", Result);
break;
case '3':
Result = Bil1 * Bil2;
Console.WriteLine("The result of multiplication is:{0}", Result);
break;
case '4':
Result = Bil1 / Bil2;
Console.WriteLine("The result of division is:{0}", Result);
break;
default:
Console.WriteLine("Invalid Option");
break;
}
Console.ReadLine();
}
}
Console.WriteLine("The result of subtraction is:{0}", Result);
break;
case '3':
Result = Bil1 * Bil2;
Console.WriteLine("The result of multiplication is:{0}", Result);
break;
case '4':
Result = Bil1 / Bil2;
Console.WriteLine("The result of division is:{0}", Result);
break;
default:
Console.WriteLine("Invalid Option");
break;
}
Console.ReadLine();
}
}
class ClassMain
{
static void Main(string[] args)
{
Calculate obj = new Calculate();
obj.Number();
}
}
}