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 ConsoleApp
- {
- class Program
- {
- static void Main(string[] args)
- {
- /* Project by Ra1n */
- string Name;
- // Name input and output.
- Console.WriteLine();
- Console.ForegroundColor = ConsoleColor.Cyan;
- Console.Write(" Enter your name: ");
- Name = Convert.ToString(Console.ReadLine());
- Console.Clear();
- Console.WriteLine();
- Console.WriteLine(" Hello, " + Name);
- Console.WriteLine();
- // First input value.
- Console.ForegroundColor = ConsoleColor.Red;
- Console.Write(" Enter a number: ");
- int x = Convert.ToInt32(Console.ReadLine());
- Console.WriteLine();
- // Second input value.
- Console.Write(" Enter another number: ");
- int y = Convert.ToInt32(Console.ReadLine());
- Console.WriteLine();
- // Sum options.
- Console.ForegroundColor = ConsoleColor.Yellow;
- Console.WriteLine(" Enter 1 for addition");
- Console.WriteLine(" Enter 2 for subtraction");
- Console.WriteLine(" Enter 3 for multiplication");
- Console.WriteLine(" Enter 4 for division");
- Console.WriteLine();
- // Select option.
- Console.ForegroundColor = ConsoleColor.Yellow;
- Console.Write(" Option: ");
- int z = Convert.ToInt32(Console.ReadLine());
- Console.WriteLine();
- Console.Clear();
- // Sum Answer
- Console.WriteLine();
- Console.ForegroundColor = ConsoleColor.Green;
- Console.Write(" The answer is: ");
- switch (z)
- {
- case 1:
- Console.WriteLine(x + y);
- break;
- case 2:
- Console.WriteLine(x - y);
- break;
- case 3:
- Console.WriteLine(x * y);
- break;
- case 4:
- Console.WriteLine(x - y);
- break;
- }
- Console.ReadKey();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement