This repository contains a basic command-line calculator program implemented in C++. The calculator supports addition, subtraction, multiplication, and division operations on two numbers.
- User-friendly menu for selecting an operation
- Support for four arithmetic operations: addition, subtraction, multiplication, and division
- Error handling for invalid input
- Option to perform multiple calculations or exit the program
To compile and run the program, you need a C++ compiler installed on your system. This program uses C++11 features, so your compiler should support the C++11 standard or later.
- Clone the repository or download the
calc.cpp
file. - Open a terminal (command prompt) and navigate to the directory containing the
calc.cpp
file. - Run the following command to compile the program:
g++ -std=c++11 -o calc calc.cpp
This will create an executable named calc
.
- Run the resulting executable with the following command:
./calc
On Windows, use calc
instead of ./calc
.
- Follow the on-screen prompts to perform calculations.
This project is released under the MIT License. See LICENSE for more information.