Loops in C#

A situation may arise during coding where you need to repeat the block of code for some number of times then the loops present in C# will come into play. Loops allow us to execute a block of code or …

Read moreLoops in C#

C# for Loop

The for loop is an entry-control loop as the condition is initially checked. It has the most efficient structure than the other two loops. The loop allows the programmer to write the execution steps together in a single line and also …

Read moreC# for Loop

C# While Loop

A while loop is an entry-control loop that evaluates the condition before executing the block of the loop. If the condition is true then the body of the loop is executed else the loop will be skipped. The loop continues …

Read moreC# While Loop

C# if statement

An if statement consists of a Boolean expression followed by a block of codes. If the Boolean expression is true, the block of code inside the if statement will be executed else if statement will be skipped. This is the simplest one …

Read moreC# if statement