C Language MCQ’S | Control Instructions 1

1.
How many times “Catalyst” gets printed?

#include<stdio.h>
int main()
{
int x;
for(x=-1; x<=10; x++)
{
if(x < 5)
continue;
else
break;
printf(“Catalyst”);
}
return 0;
}
A. Infinite times
B. 11 times
C. 0 times
D. 10 times

2.
How many times the while loop will get executed if a short int is 2 byte wide?

#include<stdio.h>
int main()
{
int j=1;
while(j <= 255)
{
printf(“%c %d\n”, j, j);
j++;
}
return 0;
}
A. Infinite times
B. 255 times
C. 256 times
D. 254 times

3.
Which of the following is not logical operator?

A. &
B. &&
C. ||
D. !

4.
In mathematics and computer programming, which is the correct order of mathematical operators ?

A. Addition, Subtraction, Multiplication, Division
B. Division, Multiplication, Addition, Subtraction
C. Multiplication, Addition, Division, Subtraction
D. Addition, Division, Modulus, Subtraction

5.
Which of the following cannot be checked in a switch-case statement?

A. Character
B. Integer
C. Float
D. enum

 

Visitor Counter

0142231