This is a simple implementation of a calculator using C. It provides basic and some special mathematical calculations.
- Basic calculations: addition, subtraction, multiplication, division, and modulo.
- Special calculations: nth root, exponentiation, logarithm, factorial and fibonacci.
- Input validation.
- C compiler (GCC or Clang)
-
Open a terminal or command prompt.
-
Navigate to the directory where the source files are located.
-
Run the following command to compile the code:
gcc *.c -o calc -lm
This command compiles all the
.c
files and generates an executable namedcalc
.
-
Execute the compiled program by running the following command:
./calc
-
Choose the operation. For example, 1 for addtion.
-
Follow the on-screen instructions and input the operand(s).
-
The program will display the result of the calculation and continue.
-
To quit the program use
CTRL + C
To remove the compiled executable and object files, run the following command:
rm calc
This is part of a demo project contribution for the Algorithmia aimed to familiarise self with contribution to open source.
This project is licensed under the MIT License.