Professional Documents
Culture Documents
Group3 PDF
Group3 PDF
ICT-GROUP 3
WHAT IS LOOP CONTROL?
C++ Loops are used to execute the same block of code a
specified number of times or while a specified condition is
true. Very often when we write code, we want the same block
of code to run over and over again in a row. Instead of
adding several almost equal lines in a code we can use
loops to perform a repetitive task like this.
Here,
initialization - initializes variables and is
executed only once
condition - if true, the body of for loop is
executed if false, the for loop is
terminated
update - updates the value of initialized
variables and again checks the condition
THE WHILE LOOP
AND DO-WHILE
DO-WHILE
LOOP PROGRAM
DIFFERENCE
WHAT IS WHILE LOOP?