An ‘if statement’ is used to test a condition. If the test condition evaluates to true (Eg. x is less than y), then the code inside the if statement will run. If the test condition evaluates to false, then the code inside the if statement won’t run and the program will continue on.
Equal to ==
Not equal to !=
Greater than >
Less than <
Greater than or equal to >=
Less than or equal to <=
Take a look at the sample code of an if statement below.
Often when using if statements, you will want to test more than just one condition. The sample code below explains how to do this.
Next tutorial: Nested if statements