C Language MCQ’S | Control Instructions 3

11.
What will be the output of the program, if a short int is 2 bytes wide?

#include<stdio.h>
int main()
{
short int i = 0;
for(i<=5 && i>=-1; ++i; i>0)
printf(“%u,”, i);
return 0;
}
A. 1 … 65535
B. Expression syntax error
C. No output
D. 0, 1, 2, 3, 4, 5

12.
What will be the output of the program?

#include<stdio.h>
int main()
{
char ch;
if(ch = printf(“”))
printf(“It matters\n”);
else
printf(“It doesn’t matters\n”);
return 0;
}
A. It matters
B. It doesn’t matters
C. matters
D. No output

13.
What will be the output of the program?

#include<stdio.h>
int main()
{
unsigned int i = 65536; /* Assume 2 byte integer*/
while(i != 0)
printf(“%d”,++i);
printf(“\n”);
return 0;
}
A. Infinite loop
B. 0 1 2 … 65535
C. 0 1 2 … 32767 – 32766 -32765 -1 0
D. No output

14.
What will be the output of the program?

#include<stdio.h>
int main()
{
float a = 0.7;
if(0.7 > a)
printf(“Hi\n”);
else
printf(“Hello\n”);
return 0;
}

A. Hi
B. Hello
C. Hi Hello
D. None of above

15.
What will be the output of the program?

#include<stdio.h>
int main()
{
int a=0, b=1, c=3;
*((a) ? &b : &a) = a ? b : c;
printf(“%d, %d, %d\n”, a, b, c);
return 0;
}
A. 0, 1, 3
B. 1, 2, 3
C. 3, 1, 3
D. 1, 3, 1