This is a basic C++ calculator program that performs arithmetic operations (+, -, *, /) on two numbers based on the operator entered by the user.
- Supports addition, subtraction, multiplication, and division.
- User inputs the operator and two numbers.
- Displays the result in a clear and formatted manner.
-
Compile the program using a C++ compiler:
g++ simpleCalculator.cpp -o simpleCalculator.exe
-
Run the executable:
./simpleCalculator.exe
-
Follow the on-screen prompts:
- Enter an operator (+, -, *, or /).
- Enter two numbers (a and b).
- View the result displayed in the format:
- Result [a b] =
Enter the operator: -
Enter the number:
a = 7
b = 9
Result [a - b] = -2
Avinash Mishra
GitHub: @avimishraa
This project is open-source and free to use for educational purposes.