If statements in Python

This tutorial explains how to test conditions and write code to make decisions using if statements and conditional operators in Python. You can also watch the video on YouTube here.

Switch statements in C#

We have looked at how to use if statements for conditional programming in C#. However, there is something else we can use if there are many different conditions or cases …

Conditional programming in C#

Conditional statements are used so that your program can make decisions based on different conditions. For example, a game might display a message to the player if their score is higher …

Do while loops in PHP

In the previous tutorial, we looked at how while loops can be used to test a condition before running a loop. While that test condition evaluates to true, the loop …

Switch statements in PHP

This tutorial explains how to use switch statements in the PHP language. Switch statements can have a number of possible execution paths, unlike if, else and else if statements. Switch …

If statements in PHP

If statements (conditional statements) are used to make decisions in your programs. An if statement will test a condition and then run a section of code if the condition evaluates …

Conditional statements in C#

Conditional statements Conditional statements are used so that your program can make decisions. When your program has a range of conditions, you can build powerful algorithms. In this tutorial, you …

Nested If Statements

The sample code below shows how to use if statements inside other if statements (nested if statements). The video here explains all about nested if statements! <!DOCTYPE html> <html lang="en" …

If else statements

Often when using if statements, you will want to test more than just one condition. The sample code below explains how to do this. You can also watch the video …

If statements

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. …

Switch Statements in JavaScript

Switch statements are used to run different blocks of code based on different conditions. They are similar to ‘If’ statements but can be a little neater when working with many conditions. This …