SultanC
  1. Home
  2. Examples
  3. Basics

Integer arithmetic

basics/arithmetic.sn
def main(): int {
    let base: int = 40;
    let increment: int = 2;
    return base + increment;
}

Run it

With the interpreter, without compiling:

./build/sultanc run examples/en/basics/arithmetic.sn

Or compile it to an executable:

./build/sultanc examples/en/basics/arithmetic.sn -o build/example && ./build/example

Source on GitHub   All examples