Welcome to your Quiz on Loop Control Statement
1.) The number of loop construct in C/C++
2.) How many times the loop will be executed?
int main() { unsigned int i = 10; while( i-- >= 0 ); }
3.) In the following loop construct, which one is executed only once always. for(initial; condition; incr)
4.) The minimum number of times while loop is executed is -
5.) The minimum number of times for loop is executed is -
6.) The minimum number of times do while loop is executed is -
7.) Which of the following looping statements end with a semi-colon (;)
9.) Which is the incorrect statements ?
10.) What are statements which result in infinte loop?
11.) How many x are printed ?
for(i=0,j=10;i<j;i++,j--)
printf("x");
12.) Which of the following control structures are used in the structured programming approach ?
13.) A typical repetition control structures comprises which of the following parts ?
14.) What is the output ?
#include
int main()
{
int n;
for(n=9; n!=0; n--)
printf("n = %d", n--);
return 0;
}
15.) How many times will nkgacademy be printed in the below program ?
#include
int main()
{
int i = 512;
for(; i; i>>=1)
printf("nkgacademy");
return 0;
}
17.) Compound statement called -
18.) What will the following code do -
int main()
{
unsigned char ch;
for(ch =0; ch<256; ch++)
printf("%c", ch)
}
19.) Which looping process is best used when we know the number of iterations ?
20.) A loop within a loop is called _________ loop.
21.) What will be the output ?
#include
int main()
{
int x = 10;
do
{
x++;
}
while(x++ > 12);
printf("%d", x);
return 0;
}
22.) What will be the output ?
#include
int main()
{
int x = 0;
for(; i<=5; i++)
printf("%d", i);
return 0;
}
23.) What will be the output ?
#include
void main()
{
int a = 10;
for(;a ;);
a++;
printf("%d", a);
}
24.) Which of these is the correct statement ?
25.) What will be the output ?
#include
int main()
{
int i=1, j=1;
for(;i<=j; j=i++ <= 1)
printf("%d%d",i,j);
return 0;
}
26.) How many times printf() function executed ?
#include
int main()
{
int i,j;
for(i=1; j<5; j++)
for(j=i; j<5; j++)
printf("*");
return 0;
}
27.) A for loop with the no test condition is known as:
28.) The sentinel-controlled loop is also known as:
29.) In counter-controlled loop, variable known as ________ is used to count the loop operations.
30.) In an exit-controlled loop, if the body is executed n times, the test condition is evaluated ______ times.