if Conditional Statements

In this lesson, an explanation of if statements and how to write them using an example is provided.

The if statement

The if statement is used when a statement or group of statements are to be executed if a condition is true. The condition will be checked, and if the condition is true, then the certain operation will be executed, and if the condition is false, then nothing will happen. The program will move to the next executable statement. Let’s understand this with the below example:

Example

Get hands-on with 1400+ tech skills courses.