Calculator with c#
A simple calculator project built with C# to practice classes, methods (functions), and basic programming logic.
- Addition (+)
- Subtraction (-)
- Multiplication (×)
- Division (÷)
- Input validation (basic)
- Calculator class: contains methods for each operation
Add(a, b)Subtract(a, b)Multiply(a, b)Divide(a, b)
- The user enters two numbers.
- The user selects an operation (+, -, ×, ÷).
- The program calls the corresponding method from the
Calculatorclass. - The result is displayed.
- Open the project in Visual Studio
- Press F5 (Start)
- Open the project folder
- Run:
dotnet run