0

Calculadora C#

Alguien me puede facilitar los códigos para hacer una calculadora por consola en C# ?

21st Jan 2020, 2:42 AM
Misael Matos
Misael Matos - avatar
2 Respostas
0
Here's a quick one that can be improved a lot - using System; namespace SoloLearn { class Program { static void Main(string[] args) { Console.WriteLine("Insert num 1"); int firstNum = Convert.ToInt32(Console.ReadLine()); Console.WriteLine("Insert num 2:"); int secondNum = Convert.ToInt32(Console.ReadLine()); Console.WriteLine("add,sub,multi,div?"); string response = Console.ReadLine(); switch(response){ case "add": Console.WriteLine(firstNum+ secondNum ); break; case "sub": Console.WriteLine(firstNum - secondNum ); break; case "multi": Console.WriteLine(firstNum * secondNum ); break; } } } }
21st Jan 2020, 3:23 AM
HNNX 🐿
HNNX 🐿 - avatar
0
thanks bro
22nd Jan 2020, 5:28 PM
Misael Matos
Misael Matos - avatar