Conditions
If statement
if (condition) {
block of code to be executed if the condition is true
}
If else statement
if (condition) {
block of code to be executed if the condition is true
} else {
block of code to be executed if the condition is false
}
else if statement
if (time < 10) {
greeting = "Good morning";
} else if (time < 20) {
greeting = "Good day";
} else {
greeting = "Good evening";
}