light
simple calculator
string value;
int res;
Console.WriteLine("enter an number lol");
int number1 = Convert.ToInt32(Console.ReadLine());
Console.WriteLine("enter another number");
int number2 = Convert.ToInt32(Console.ReadLine());
Console.WriteLine("put ,/,-,+");
string symbol = Console.ReadLine();
switch (symbol)
{
case "":
res = number1 * number2;
Console.WriteLine(res);
break;
case "/":
res = number1 / number2;
Console.WriteLine(res);
break;
case "+":
res = number1 + number2;
Console.WriteLine(res);
break;
case "-":
res = number1 - number2;
Console.WriteLine(res);
break;
} Console.WriteLine("wana continue (y) (n)"); value = Console.ReadLine(); while (value == "y" || value == "Y") ;
} Console.WriteLine("wana continue (y) (n)"); value = Console.ReadLine(); while (value == "y" || value == "Y") ;
12 replies