Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/Project516/c-calc/llms.txt

Use this file to discover all available pages before exploring further.

This page shows the fastest way to go from source code to a working calculation. You will build c-calc, run it in non-interactive mode with command-line arguments, and then try the interactive prompt-driven mode.
Make sure you have GCC and make installed before continuing. See Install c-calc from source if you haven’t built the binary yet.
1

Build the binary

In the project directory, run:
make
Alternatively, use the convenience script to build and launch in one command:
./run.sh
A c-calc binary appears in the project directory when the build succeeds.
2

Run a calculation (non-interactive)

Pass two numbers and an operator as arguments:
./c-calc 1 + 1
Output:
Result: 2.0000
c-calc supports +, -, *, /, and %. All results are printed with four decimal places.
./c-calc 10 / 3
Result: 3.3333
./c-calc 7 % 3
Result: 1.0000
3

Run in interactive mode

Run c-calc with no arguments to enter interactive mode:
./c-calc
c-calc prompts you for each input in turn:
This is a simple calculator written in c
Enter your first number: 42
Enter operator: *
Enter your second number: 3
Result: 126.0000
Type the first number and press Enter, then the operator, then the second number. c-calc prints the result and exits.

What’s next

Interactive mode

Learn more about the prompt-driven workflow.

Non-interactive mode

Use c-calc in shell scripts and pipelines.

Build docs developers (and LLMs) love