Page 67 - Modular_V1.1_Flipbook
P. 67
5. Which of the following is not a jump statement in C++?
a. goto c. for
b. continue d. break
B. Write ‘T’ for true and ‘F’ for false.
1. There is no difference between do-while and while loops. ……………………
2. Continue statement breaks the loop. ……………………
3. Break statement can break out of multiple loops at a time. ……………………
4. Do-while loop checks the condition at the end. ……………………
5. Continue statement skips the current iteration of the loop. ……………………
C. Fill in the blanks using the words given below.
do-while, infinite, Iteration, nested, three
1. C++ provides ……………….....…… kinds of loops.
2. The body of the ……………….....…… loop executes at least once.
3. ……………….....…… is the process of running a loop one time.
4. If a loop executes inside another loop, it is known as ……………….....…… loop.
5. The loop that never ends is called ……………….....…… loop.
D. Short answer type questions.
1. What is the purpose of looping statements?
2. Write the names of all the jump statements provided by C++.
3. Write the syntax to declare a variable inside the for loop.
4. What is the use of goto statement in C++?
E. Long answer type questions.
1. Differentiate between break and continue statements.
2. Write any two differences between while and do-while loops.
3. Can a while loop contain another while loop? If yes, write the syntax to do the same.
F. Find the output of the following codes:
1. int num = 8;
for(int i = 1; i <= num; i++)
if(i==5)
continue;
else
cout<<i << “\n”;
Loops 65

