Calculator Program
using System;
namespace My_Awsome_Program
{
class Program
{
static void Main(string[] args)
{
{
Calculator();
Console.ReadKey();
}
static void Calculator()
{
int results = 0;
Console.WriteLine("Please enter 2 numbers: ");
int num01 = Convert.ToInt32 (Console.ReadLine());
int num02 = Convert.ToInt32 (Console.ReadLine());
Console.WriteLine("Please enter the oparation you want to do: ");
string oparation = (Console.ReadLine());
if (oparation == "*")
{
results = num01 * num02;
Console.WriteLine(+ results);
}
else if (oparation == ":")
{
results = num01 / num02;
Console.WriteLine(+ results);
}
else if (oparation == "-")
{
results = num01 - num02;
Console.WriteLine(+ results);
}
else if (oparation == "+")
{
results = num01 + num02;
Console.WriteLine(+ results);
}
}
}
}
}
Σχόλια
Δημοσίευση σχολίου