CS 1044- Final Exam Guide - Comprehensive Notes for the exam ( 116 pages long!)
Document Summary
The statements that cause a set of statements to be executed repeatedly either for a specific number of times or until some condition is satisfied are known as iteration statements. That is, as long as the condition evaluates to true, the set of statement(s) is executed. The various iteration statements used in c++ are for loop, while loop and do while loop. The for loop is one of the most widely used loops in c++. The for loop is a deterministic loop in nature, that is, the number of times the body of the loop is executed is known in advance. The syntax of the for loop is for(initialize; condition; update) Note that initialize, condition and update are optional expressions and are always specified in parentheses. All the three expressions are separated by semicolons. The semicolons are mandatory and hence cannot be excluded even if all the three expressions are omitted.