Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace SimpleCalc
- {
- class Program
- {
- static void Main(string[] args)
- {
- Console.Write("Enter first number: ");
- int a = int.Parse(Console.ReadLine());
- Console.Write("Enter second number: ");
- int b = int.Parse(Console.ReadLine());
- Console.Write("Choice operation: ");
- string choice = Console.ReadLine();
- switch (choice)
- {
- case "+":
- {
- Console.WriteLine("Result: " + (a + b));
- Console.ReadKey(true);
- break;
- }
- case "*":
- {
- Console.WriteLine("Result: "+(a * b));
- Console.ReadKey(true);
- break;
- }
- default:
- {
- Console.Write("Invalid operation !");
- Console.ReadKey(true);
- break;
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement