NabeelScript Control Structures

Control Structures

If-Else Statements

if x > 10 {
    print("x is greater than 10");
} elseif x > 5 {
    print("x is greater than 5 but not greater than 10");
} else {
    print("x is 5 or less");
}

While Loops

i = 0;
while i < 5 {
    print(i);
    i = i + 1;
}

For Loops

for (i = 0; i < 5; i = i + 1) {
    print(i);
}