An open API service indexing awesome lists of open source software.

https://github.com/basemax/mathematicalexpressionevaluator

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.
https://github.com/basemax/mathematicalexpressionevaluator

calculator calculator-app calculator-application calculator-cpp cpp cpp-calculator expression-calculate expression-checker expression-evaluator expression-language expression-parser expression-tree expressions mathematical

Last synced: 6 months ago
JSON representation

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.

Awesome Lists containing this project

README

          

# Mathematical Expression Evaluator

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.

## Usage

Clone the repository or download the source code files:

```shell
git clone https://github.com/BaseMax/MathematicalExpressionEvaluator
```

Compile the source code using a C++ compiler:

```shell
g++ main.cpp -o math_expression_evaluator
```

Run the program:

```shell
./math_expression_evaluator
```

Enter a mathematical expression without spaces and press Enter. The program will evaluate the expression and display the result.

## Examples

**Expression:** (5+((8+2)*2))

**Result:** 25

---------------

**Expression:** ((6*(2+1))*(3+(3+1)))

**Result:** 126

## License

This project is licensed under the GPL-3.0 License.

Copyright 2023, Max Base