1. Which statement is not a part of the control statement?
a. Switch
b. For.
c. While
d. Void sum()
Ans: d
2. How many times "Coding Champ" is get printed?
int main()
{
int x;
for(x==1; x<=10; x++)
{
if(x<5)
{
continue;
else
{
break;
}
printf("Conding Champ");
}
{
int x;
for(x==1; x<=10; x++)
{
if(x<5)
{
continue;
else
{
break;
}
printf("Conding Champ");
}
a. infinite times.
b. 0 times
c. 11 times
d. 10 times
Ans: a
3. Which of the following is not a relational operator?
a. <
b. >
c. ==
d. &&
Ans: d
4. What is the output of the following program?
#include<stdio.h>
int main()
{
int i;
if(printf("0"))
{
i = 3;
else
{
i = 5;
print("%d", i);
return 0;
}
int main()
{
int i;
if(printf("0"))
{
i = 3;
else
{
i = 5;
print("%d", i);
return 0;
}
a. 3
b. 4
c. 5
d. None of these.
Ans: a
5. How many times do while loop guaranteed to run?
a. 0
b. infinite
c. 1
d. None of the above.
Ans: c
6. Which loop is faster in C language?
a. For.
b. while.
c. do-while
d. All work at the same speed.
Ans: d
7. What is the output of this program?
int main()
{
while(a)
{
printf("Conding Champ");
break;
}
return 0;
}
{
while(a)
{
printf("Conding Champ");
break;
}
return 0;
}
a. Coding Champ
b. No Output.
c. Infinite Loop
d. Compiler Error
Ans: d
8. Continue statement can't be used with?
a. for.
b. while.
c. do-while
d. Switch
Ans: d
9. Switch statement allow.
a. int.
b. char.
c. long.
d. All of the above.
Ans: d
10. What is the output of the following program?
int main()
{
int a= 10, b, c;
b = a++;
c = ++a;
printf("%d %d %d", a, b, c);
return 0;
a. 10 11 12
b. 12 10 12
c. 12 11 12
d. 12 12 12
Ans: b
0 Comments