1. In a nested loop, which loop closes at last?
a) Outermost loop
b) Innermost loop
c) Inner and outer loop together
d) None of the above
2. When the statements are executed sequentially in a program, the construct is known as iteration.
a) True
b) False
3. Which statement helps to take jump from one loop to another loop?
a) switch
b) continue
c) break
d) if else
4. Among the following which one allows repetitive execution of the statement?
a) for
b) while
c) do-while
d) All of them
5. Which of the following statement executes at least one time?
a) for
b) do-while
c) while
d) Nested loop
6. How many times will the loop execute?
for (i=1; ; i++)
{}
a) 0
b) 1
c) Infinite
d) None
7. Which loop is executed with fixed iteration?
a) for
b) while
c) do-while
d) All of them
8. In which of the following statements the loop will be executed 10 times?
a) for (i=3; i<=30; i=i+3)
b) for (i=0; i<10; i++)
c) for (i=6; i<26; i=i+2)
d) All of them
9. while(flag)
{
//statements
}
The statement will be executed util the value of flag becomes:
a) 1
b) 0
c) True
d) False
10. Which loop checks the condition first and then execution begins?
a) do-while
b) do
c) while
d) for