Simple Calculator in C This is a calcultor written in C. It performs operations such as addition, subtraction, multiplication, division, reminder, power, square root and cube root. The calculator takes the operation input through a choice menu, proceeding forward with the number input form the user.
Features:
- performs functions like:
- addition
- subtraction
- multiplication
- division
- reminder (Modulus)
- power (math.h libarary)
- square root (math.h library)
- cube root (math.h library)
- User-friendly interface with a command-line input/output system.
- Error handling for division by zero.
- Loop functionality allows user to perform multiple calculations without restarting the program.
library used:
- #include<stdio.h>
- #include<math.h>
How to Use:
- compile the program using a c compiler(eg GCC): gcc simpleCalculator.c -o simpleCalcualtor
- Run the program: ./simpleCalculator
- Follow the on-screen prompts:
- input the choice number of the desired operation.
- input the numbers.
- exit the program selecting exit or continue calculating.
Prerequisites:
- C compiler installed in your system.
- Basic understanding of command line operations.
Customization:
- Adding more operations (eg: trignometric operations).
- improving the user-interface.
- Adding history feature.