This loop is called controlled loop in C. it genraly divided in three parts initializaton ,condition and
expression[increment/decrement,etc.] all three parts are optional.
If you do’nt give condition to for looop it become true and run infinit times.


1. for( initializaton ; condition ; expression )
statement ;

2. for( initializaton ; condition ; expression )
statement_1 ;
statement_2 ;
statement_3 ;

NOTE : remember the ( ; ) semicolon after each part.

initializaton : In this part we can store values in variable those will used by loop statement.
or we can say we can do our initializaton here in this part.
This part of for loop execute first and once only.

condition : you use a lots of condition in while or do-while loop this is same in this part we can write our condition.
This place in for loop is check each time during execution. if condition become false then loop stop executing.

expression : In this part of loop we can write any expression which execute after running body of loop. amd execute each time
loop will execute.

In this loop first of all the initializaton part will execute it will execute once then
or conditional part will execute after initializaton it check every time and if it,s true then loop
will execute after checking the condition the flow of loop will move forwarde
now the body of loop will execute after running hole body of loop
The expression will execute after executing body of loop and
after it again the condition will check and loop will flow continusly untill condition become


Now ready for a lots of question on for loop.

1 Comment

  1. The brand new idea is here). I have read the post with excellent satisfaction and also could know something new
    that I will use for my further requirements. The article is clear and bright, with no additional
    useless facts or else, it reminded me The language is
    both brilliant and vivid, so the more I read, the more
    I do enjoy it! Besides, the information is rather cutting edge,
    so just like it.


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s