CIS 1057 Chapter Notes - Chapter 6: Infinite Loop, Increment And Decrement Operators

30 views3 pages

Document Summary

A counter-controlled loop (counting loop) is a loop whose required number of iterations can be determined before the loop execution begins. Controlled by a loop control variable whose value represents a count. The block of code is repeated until the condition evaluates to false, at which point the loop is exited. Loop repetition condition is the condition that controls loop condition. Loop control variable i the variable whose value controls the loop. Generally, a while statement needs the lcv to be initialized, tested, and updated. If there is not updating to the lcv, the loop can be an infinite loop. An infinite loop is a loop that executes forever. Computing a sum or a product in a loop. Loops often accumulate sums or products via repeated addition/multiplication/etc. An accumulator is a variable used to store a value being computed in increments during the execution of the loop.

Get access

Grade+
$40 USD/m
Billed monthly
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
10 Verified Answers
Class+
$30 USD/m
Billed monthly
Class+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
7 Verified Answers

Related Documents