SultanC
  1. Home
  2. Examples
  3. Basics

Prints a greeting and a computed number

Output: two lines.

basics/hello.sn
// Prints a greeting and a computed number. Output: two lines.
import std.io.println;
import std.text.number;

def main(): int {
    println("Hello from SultanC");
    let answer: int = 6 * 7;
    println(int_to_text(answer));
    return 0;
}

Run it

With the interpreter, without compiling:

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

Or compile it to an executable:

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

Source on GitHub   All examples