A simple and convenient calculator for performing basic mathematical operations through the console.
- Addition
- Subtraction
- Multiplication
- Division
- Exponentiation
- Continuous operation mode
- Error handling (division by zero, invalid input)
- C compiler (GCC, Clang, or other)
- Standard C library with
math.hsupport
gcc main.c -o calculator -lmgcc main.c -o calculator.exe -lmRun the program:
./calculatorEnter expression in format: number operator number
5 + 3
Result: 8.00
10 / 2
Result: 5.00
2 x 8
Result: 256.00
15 - 7
Result: 8.00
6 * 4
Result: 24.00
| Symbol | Operation |
|---|---|
+ |
Addition |
- |
Subtraction |
* |
Multiplication |
/ |
Division |
x |
Exponentiation (a^b) |
Enter: 0 q 0
The program correctly handles:
- Division by zero
- Invalid input format
- Unknown operators
.
├── main.c # Main program file
└── README.md # Documentation
This project is licensed under the MIT License.
Max-Mend
Created as an educational project to demonstrate basic C capabilities.