REPETITION STRUCTURES Lecture 1.10
Prepared by: Mian Saeed Akbar
REPETITION STRUCTURES
Repetition Structures
while structure
 Makes loop continuation test at beginning
 Loop body may or may not executes depending on the condition
do/while structure
 Similar to while structure
 Makes loop continuation test at end, not beginning
 Loop body executes at least once
for structure
 Makes loop continuation test at beginning
 Loop body may or may not executes depending on the condition
while ( condition )
{
statement
}
do {
statement
} while ( condition );
for(initialization; condition; update)
{
statement
}
Thank you
Please subscribe my channel for more videos
and courses

Lecture 1.10 Repetition Structures.pdf

  • 1.
    REPETITION STRUCTURES Lecture1.10 Prepared by: Mian Saeed Akbar
  • 2.
    REPETITION STRUCTURES Repetition Structures whilestructure  Makes loop continuation test at beginning  Loop body may or may not executes depending on the condition do/while structure  Similar to while structure  Makes loop continuation test at end, not beginning  Loop body executes at least once for structure  Makes loop continuation test at beginning  Loop body may or may not executes depending on the condition while ( condition ) { statement } do { statement } while ( condition ); for(initialization; condition; update) { statement }
  • 3.
    Thank you Please subscribemy channel for more videos and courses