Monday , July 4 2022
Home / C# / C# – Loops

C# – Loops


C# – Loops by onlineteachinghub

In this video we will learn about 4 kinds of loops in C#:

For loop: Used to repeat actions until a limit is met

for(initialize; limit; increment){
    // Do action here

While loop: Used to repeat action until a condition is met

while( condition ){
    // Do action here

Do-while loop: Same as while loop but the “do” part runs first

    // Do action here
}while( condition );

Foreach loop: Used on arrays

foreach ( var a in SomeArray ){
    // Do action here

About Waleed Baig

I am doing BS Computer Science. I have a passion to learn new technology and spread it. I am more enthusiastic about learning complex algorithm and making creative and efficient solution to a problem.

Check Also

C# 09 – Learning methods

In this tutorial we will learn What are methods? and How to create a method …

Leave a Reply

Your email address will not be published.