




























Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!





























10_loops.ppt
Begin or End Input or Output
Processing Decision
Branch or Direction of Flow
Flow Control Structures
While is a Pretest Loop - Example
intCount = 1; //initialize controlling variable
while (intCount < 4)
{ txtCount.Text = intCount.ToString(โN0โ); intCount++; //add one
}
Output:
1 2 3
Do-While is a Posttest Loop -Example
intCount = 1; //initialize controlling variable
do
{ txtCount.Text = intCount.ToString(โN0โ); intCount++;
} w hile (intCount < 4 );
Output:
1 2 3
//For includes initialization and ending condition
for ( int intCount = 1; intCount < 4; intCount++;) { txtCount.Text = intCount.ToString(โN0โ); }
Output:
1 2 3
count = 1
while count < 4
Output count
count +
Next statement
False
True
Represents Skip or Exit Loop Loop