Files
fz-lang/exl/01_conditions.fzs
2026-10-25 04:51:37 +03:00

31 lines
663 B
Plaintext

// When you need to check some value
// a conditional statement might help you
int valueToCheck = 2 + 2;
if (valueToCheck == 4)
{
printline("Yay! 2 + 2 = 4");
}
// Conditional statement uses condition in parenthesis
// after `if` keyword and executes command(s) after
// if condition turns out to be true
// Otherwise, to execute block when condition turns
// out to be false, you can use `else` keyword:
int age = 30;
if (age <= 20)
printline("You're too young");
else
{
age = 20;
printline("You look too young!");
}
// NOTE: If you need to execute only one statement
// inside `if` or `else` block, then the curly
// braces can be omitted.