if
Statement
true
or false
.
The if statement accepts Boolean values – if the value is true then it will execute the block of statements under it. |
|
If we do not provide the curly braces ‘{’ and ‘}’ after if (condition) |
|
if
is in lowercase letters.
Uppercase letters (If
or IF
) will generate an error.
In the example below, we test two values to find out if 20 is greater than 18.
If the condition is true, print some text:
|
|