Tue 10 July 2018, in category Conditional
An if condition allows you to check for a given condition if its true, then that statement is executed.
In the examples below, we're checking an integer variable i to see if it's less than 10.
if(i < 10) {
System.out.println("i is Less than 10!");
}
if (i < 10) {
Console.WriteLine("i is Less than 10!");
}
if i < 10:
print("i is Less than 10!")
if (i < 10) {
console.log("i is Less than 10!")
}
if i < 10 {
fmt.Println("i is Less than 10!")
}