Академический Документы
Профессиональный Документы
Культура Документы
ANDHRA PRADESH
CM304.49 2
What is repetitive structure (loop)?
Flow of execution
Statements
CM304.49 3
Loops Contd..
CM304.49 4
Types of loops
CM304.49 5
while loop
It is a top-tested loop.
CM304.49 6
General form of the while loop
while (condition)
{
body of the loop;
}
statements-x;
loop
True
Execute statements
CM304.49 8
Simple program using while loop
#include<stdio.h>
main() This is
{ condition
int i;
i=1;
while (i<=10)
{
printf (“%d \n ”,i);
i=i+1; This is body of the
} loop
}
CM304.49 9
Summary
CM304.49 10
Quiz
of times.
(b) No repetition of statements.
(c) No action.
CM304.49 11
Quiz
of times.
(b) No repetition of statements.
(c) No action.
CM304.49 12
Quiz
CM304.49 13
Quiz
CM304.49 14
Quiz
CM304.49 15
Quiz
3. How many minimum iterations are done in
while loop?
(a) 0 iteration.
(b) 1 iteration.
(c) Infinite.
CM304.49 16
Frequently Asked Questions
CM304.49 17