This is a simple terminal-based calculator built with C++. It performs basic arithmetic operations such as addition, subtraction, multiplication, and division.
- Basic arithmetic: +, -, *, /
- Terminal-based input and output
- Simple and beginner-friendly structure
- Easy to extend with more operations or features
You need a C++ compiler installed on your system:
- On Linux (Ubuntu/Debian):
sudo apt install g++ - On Windows: Install MinGW or use an IDE like Code::Blocks or Visual Studio
- On macOS: Install Xcode Command Line Tools with
xcode-select --install
Open a terminal in the project directory and run:
g++ -o calculator calculator.cpp
This will generate an executable named calculator.
To run the calculator:
./calculator
(On Windows, run calculator.exe instead.)
Enter first number: 8
Enter operator (+, -, *, /): *
Enter second number: 5
Result: 40
calculator.cpp- Main source fileREADME.md- Project documentation
Feel free to fork the repository and submit pull requests for improvements or new features.
This project is licensed under the MIT License. See the LICENSE file for details.