Expert Dot Net

Trust me to find new way !

C# For Loop

Loop is used in programming when you need to repeat any group of statement or statement more then one time. For loop is one important looping construct which is used to iterate set of instructions.


for ( int i=0 ; i <= 5 ; i++)

{

// Your statements

}


There are 4 parts of this for loop.


- First part is initialization

- Second part is condition checking

- Third part is increment / decrements

- Fourth part is group of statements which basically would be executed.


Demo 1 :