Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace test
- {
- class Program
- {
- static void Main(string[] args)
- {
- //variable
- int choice, formula, number1, number2;
- do
- {
- //give user the choices
- Console.WriteLine("1.Addition Calculator");
- Console.WriteLine("2.Multiplication Calculator");
- Console.WriteLine("3.Exit Calculator");
- //ask user to enter their choices
- Console.Write("What is your choices: ");
- choice = int.Parse(Console.ReadLine());
- if (choice == 1)
- {
- Console.WriteLine("Please enter 2 numbers: ");
- number1 = int.Parse(Console.ReadLine());
- number2 = int.Parse(Console.ReadLine());
- formula = number1 + number2;
- }else if (choice == 2)
- {
- Console.WriteLine("Please enter 2 numbers: ");
- number1 = int.Parse(Console.ReadLine());
- number2 = int.Parse(Console.ReadLine());
- formula = number1 * number2;
- }else
- {
- Console.WriteLine("Noob");
- }
- Console.WriteLine("Your answer is: {0}", formula);
- } while (choice != 3);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement