Professional Documents
Culture Documents
ASSIGNMENT C++ Adibah
ASSIGNMENT C++ Adibah
b)While
Unlike for and while loops, which test the loop condition at the top of the loop,
the do...while loop checks its condition at the bottom of the loop.
A do...while loop is similar to a while loop, except that a do...while loop is
guaranteed to execute at least one time.
There are two statements ( break ; and continue ; ) built in C++ programming to alter the
normal flow of program.
Loops are used to perform repetitive task until test expression is false but sometimes it is
desirable to skip some statement/s inside loop or terminate the loop immediately with
checking test condition. On these type of scenarios,
and
break;
continue;
statement
switch statement.
d) While true
e) Do / While
f) Jump / Loop
Loops are used to perform repetitive task until test expression is false but
sometimes it is desirable to skip some statement/s inside loop or
terminate the loop immediately with checking test condition. On these
g) If / else