This is a C++ program that evaluates mathematical expressions containing operators +
, -
, *
, and /
, and parentheses (
and )
. The program supports multi-digit numbers and guarantees that parentheses are used for each operator.
Clone the repository or download the source code files:
git clone https://github.com/BaseMax/MathematicalExpressionEvaluator
Compile the source code using a C++ compiler:
g++ main.cpp -o math_expression_evaluator
Run the program:
./math_expression_evaluator
Enter a mathematical expression without spaces and press Enter. The program will evaluate the expression and display the result.
Expression: (5+((8+2)*2))
Result: 25
Expression: ((6*(2+1))*(3+(3+1)))
Result: 126
This project is licensed under the GPL-3.0 License.
Copyright 2023, Max Base