Member-only story
Coding 101: The IF, ELSE IF, and ELSE statements EXPLAINED-The Test Lead
When you are first getting introduced to the world of coding it may seem overwhelming. It is essential to understand the basics first, and then you could build on them. One of the core functionalities in programming that is used throughout every object-oriented programming language is the “If” statement.
This article will:
- Define what the if statement is
- Breakdown the structure of the if statement
- Show the different comparisons that can be used in an if statement
- Show how it is used in code
What is an if statement?
An if statement is a conditional statement in code that tells your program what to do with certain pieces of information. In English, computers are not smart enough to think fully for themselves, yet. An if statement lets your program make decisions while it is running. You will predefine statements and checks that if your program meets the criteria for while it is executing, it will then carry out certain tasks.