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.

c-calc is a lightweight command-line calculator written in C. It runs on Linux, macOS, and Windows (via MSYS2), and supports two modes of operation: an interactive prompt-driven mode and a non-interactive mode where you pass operands and an operator directly as arguments.

Installation

Install GCC and build c-calc from source in a few steps

Quickstart

Run your first calculation in under a minute

Interactive mode

Use c-calc with step-by-step prompts for operands and operator

Non-interactive mode

Pass arguments directly on the command line for scripting

What c-calc supports

c-calc performs arithmetic on two numbers using a single operator. Results are always displayed with four decimal places.

Addition

+ — sum of two numbers

Subtraction

- — difference of two numbers

Multiplication

* — product of two numbers

Division

/ — quotient of two numbers

Modulo

% — remainder of integer division
Division by zero is handled gracefully — c-calc prints an error message instead of crashing.

Get started

1

Install GCC

Install the GCC compiler for your platform. On Linux use your package manager, on macOS use Homebrew, and on Windows use MSYS2.
2

Build c-calc

Run make in the project directory to compile the binary.
3

Run a calculation

Use interactive mode by running ./c-calc, or pass arguments directly: ./c-calc 10 / 3

Build docs developers (and LLMs) love