1. MAYUR PATEL(150990119031)
MEET PATEL(150990119032)
PARTHIV PATEL (150990119033)
PAVAN PATEL (150990119034)
PINKAL PATEL (150990119035)
TOPIC :- LOOP
(mechanical Engineering; 2nd Sem)
Shroff S. R. Rotary Institute Of
Chemical Technology
2. Content.
• [1] Introduction To Loop.
• [2] While Loop.
• [3] Do While Loop.
• [4] For Loop.
• [5] Nested Loop.
3. LOOP
• Loop are used to repeat particular set of statement
upto some fixed iteration in c language.
• There Are Three types of loop :
• 1)while loop
• 2) do….while loop
• 3) for loop
These loops are catagarized into entry control loop and
exit control loop .
4. Entry control loop v/s Exit control loop
Entry control loop
• The Condition is checked in
the STARTING of the loop.
Eg: For & while loop.
Exit control loop
• The Condition is checked in
the END of the loop.
• Eg: do while loop.
5. The while statement
• While loop is the entrycontrol loop in wich the
condition is evaluated at the staring of the loop.
• The test condition is evaluated and if it is true,the
body of the loop is exicuted.after execution of
the body, the condition is again evaluated and if it
is true,the body of the loop is exicuted again.this
process continues until the test condition
becomes false and the control is transferred out
of the loop.
9. do_while loop
• Do_while loop is the exit control loop in which the
condition is evaluated at the end of the loop
It is an exit controlled loop statement. The body of
the loop of do statement is compulsorily executed
for the first time. After executing once., at the end of
the loop, the test condition in the while statement is
evaluated. If the condition is true, the body of the
loop is executed again and this process continuous
until the condition becomes false.
13. The for statement:
• It is also an entry-controlled loop.
• For loop is very dynamic loop in c language in
which initilization,conditionand update is
done in single statement.
16. Nested loop:-
• Loop within loop is known as nested loop
• In case of nested loop the inner loop is
exicuted first then after complition of all the
values of inner loop the outer loop is exicuted