c-calc is a lightweight command-line calculator written in C. It takes two numbers and one operator, computes the result, and prints it — nothing more. This page explains what c-calc is, what it supports, and how to get started.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.
What c-calc does
c-calc performs arithmetic on two operands using a single binary operator. Results are always printed with four decimal places:make command and has no runtime dependencies beyond the C standard library.
Supported operators
c-calc supports five arithmetic operators:| Operator | Operation | Example |
|---|---|---|
+ | Addition | 1 + 2 → 3.0000 |
- | Subtraction | 5 - 3 → 2.0000 |
* | Multiplication | 4 * 3 → 12.0000 |
/ | Division | 9 / 2 → 4.5000 |
% | Modulo | 7 % 3 → 1.0000 |
Division by zero is handled gracefully — c-calc prints an error message instead of crashing.
Two modes of operation
c-calc runs in two modes depending on how you invoke it. Interactive mode — run./c-calc with no arguments. c-calc prompts you for the first number, the operator, and the second number one at a time.
Non-interactive mode — pass all three arguments on the command line. Useful for scripting or one-off calculations without prompts.
License
c-calc is released under the AGPL-3.0 license.Next steps
Install c-calc
Install GCC and build c-calc from source on Linux, macOS, or Windows.
Quickstart
Run your first calculation in under a minute.