Control Flow
If-Else Statements
Section titled “If-Else Statements”int age = 18;
if (age >= 18) { print("Adult");} else { print("Minor");}
// Logical operatorsif (age >= 18 && age < 65) { print("Working age");}While Loop
Section titled “While Loop”int i = 0;while (i < 10) { if (i == 5) continue; if (i == 8) break; print(i); i++;}For Loop
Section titled “For Loop”Tulpar supports both C-style for loops and for-each loops:
// C-style for loopfor (int i = 0; i < 10; i++) { print("i =", i);}
// For-each with rangefor (i in range(10)) { print("i =", i);}