// يطبع تحية وعددا محسوبا. الخرج: سطران.
استورد std.io.println;
استورد std.text.number;
عرف الرئيسية(): عدد {
اطبع_سطر("مرحبا من السلطان");
دع الجواب: عدد = 6 * 7;
اطبع_سطر(عدد_إلى_نص(الجواب));
أرجع 0;
}// 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;
}
التشغيل
بالمفسر، دون ترجمة:
./build/sultanc run examples/ar/basics/hello.snأو ترجمه إلى ملف تنفيذي:
./build/sultanc examples/ar/basics/hello.sn -o build/example && ./build/example