feat: add examples with descriptions

This commit is contained in:
samsonium
2026-10-21 04:00:48 +03:00
parent e49ebba346
commit 138d503bce
3 changed files with 92 additions and 0 deletions
+30
View File
@@ -0,0 +1,30 @@
// When you need to check some value
// a conditional statements might help you
int valueToCheck = 2 + 2;
if (valueToCheck == 4)
{
printline("Yay! 2 + 2 = 4");
}
// Conditional statement uses condition in pairs
// 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 looks too young!");
}
// NOTE: If you need to execute only one statement
// inside `if` or `else` block, then the curly
// braces can be omitted.