Search this site
Embedded Files
Skip to main content
Skip to navigation
dsd-group11
Home
Group Members
Textbook
Chapter 1
Chapter 2
Chapter 3
Chapter 4
Chapter 5
Chapter 6
Chapter 7
Chapter 8
Chapter 9
Chapter 10
Chapter 11
Chapter 12
Labs
Lab 1
Lab 2
Lab 3
Lab 4
Lab 5
Lab 6
Projects
dsd-group11
Home
Group Members
Textbook
Chapter 1
Chapter 2
Chapter 3
Chapter 4
Chapter 5
Chapter 6
Chapter 7
Chapter 8
Chapter 9
Chapter 10
Chapter 11
Chapter 12
Labs
Lab 1
Lab 2
Lab 3
Lab 4
Lab 5
Lab 6
Projects
More
Home
Group Members
Textbook
Chapter 1
Chapter 2
Chapter 3
Chapter 4
Chapter 5
Chapter 6
Chapter 7
Chapter 8
Chapter 9
Chapter 10
Chapter 11
Chapter 12
Labs
Lab 1
Lab 2
Lab 3
Lab 4
Lab 5
Lab 6
Projects
Chapter 12
Looping Constructs
for
and
while
Loops
If you know the number of iterations the loop requires, you should use a
for
loop
for
loop allows you to explicitly state the number of iterations that the loop performs
while
loop should be used when you do not know the number of iterations the loop needs to perform
loop stops iterating when the terms stated in the condition clause are not met
Loop Control:
next
and
exit
Statements
next
Statement:
allows for the loop to bypass the remaining statements within the body of the loop and start immediately at the next iteration
exit
Statement:
allows for the immediate termination of the loop
Report abuse
Page details
Page updated
Report abuse