This is the fourth in a series of computer science lessons about programming with C# for beginners. In this lesson you will learn how to use the if statement. The if statement is a selection construct that allows you to execute blocks of code conditionally, that is, how to run specific groups of instructions depending on the outcome of a test. You will learn about the syntax of the if statement including the else if and else clauses. You will also learn how to use relational and logical operators when creating conditions for the if statement.
Chapters:
00:00 Introduction
00:45 if statement
03:47 else if
05:28 else
06:25 Testing numeric values
07:45 Relational operators
09:16 Logical operator AND
13:11 Exercise
14:10 Solution