Sail E0 Webinar

MCQs

Total Questions : 24 | Page 2 of 3 pages
Question 11. What will be the output?
void main(){
int a=10, b=20;
char x=1, y=0;
if(a,b,x,y){
printf("EXAM");
}
}
  1.    XAM is printed
  2.    exam is printed
  3.    Compiler Error
  4.    Nothing is printed
 Discuss Question
Answer: Option D. -> Nothing is printed
Question 12. What is the output of the following statements?
int i = 0;
printf("%d %d", i, i++);
  1.    0 1
  2.    1 0
  3.    0 0
  4.    1 1
  5.    None of these
 Discuss Question
Answer: Option B. -> 1 0
Question 13. What number will z in the sample code given below?
int z, x=5, y= -10, a=4, b=2;
z = x++ - --y*b/a;
  1.    5
  2.    6
  3.    9
  4.    10
  5.    11
 Discuss Question
Answer: Option D. -> 10
Question 14. What is the output of the following statements?
int b=15, c=5, d=8, e=8, a;
a = b>c ? c>d ? 12 : d>e ? 13 : 14 : 15;
printf("%d", a);
  1.    13
  2.    14
  3.    15
  4.    12
  5.    Garbage Value
 Discuss Question
Answer: Option B. -> 14
Question 15. What will be the output of the following code fragment?
void main()
{
printf("%x",-1
  1.    fff0
  2.    fff1
  3.    fff2
  4.    fff3
  5.    fff4
 Discuss Question
Answer: Option A. -> fff0
Question 16. Find the output of the following program.
#include
void main()
{
int y=10;
if(y++>9 && y++!=10 && y++>11)
printf("%d", y);
else
printf("%d", y);
}
  1.    11
  2.    12
  3.    13
  4.    14
  5.    Compilation error
 Discuss Question
Answer: Option C. -> 13
Question 17. Determine output of the following program code.
#include
void main()
{
int a, b=7;
a = b1 : a;
printf("%d %d", a, b);
}
  1.    3 7
  2.    7 3
  3.    8 3
  4.    3 8
  5.    None of these
 Discuss Question
Answer: Option D. -> 3 8
Question 18. Find the output of the following program.
#include
void main()
{
int y=10;
if(y++>9 && y++!=11 && y++>11)
printf("%d", y);
else
printf("%d", y);
}
  1.    11
  2.    12
  3.    13
  4.    14
  5.    Compilation error
 Discuss Question
Answer: Option B. -> 12
Question 19. Consider the following program fragment, and choose the correct one
void main()
{
int a, b = 2, c;
a = 2 * (b++);
c = 2 * (++b);
}
  1.    a = 4, c = 8
  2.    a = 3, c = 8
  3.    b = 3, c = 6
  4.    a = 4, c = 6
  5.    b = 4, c = 6
 Discuss Question
Answer: Option A. -> a = 4, c = 8
Question 20. Choose the correct output for the following program.
#include
void main()
{
int a=10, b=11, c=13, d;
d = (a=c, b+=a, c=a+b+c);
printf("%d %d %d %d", d, a, b, c);
}
  1.    50, 13, 11, 13
  2.    50, 13, 24, 50
  3.    13, 10, 24, 50
  4.    50, 13, 24, 13
  5.    13, 13, 24, 13
 Discuss Question
Answer: Option B. -> 50, 13, 24, 50

Latest Videos

Latest Test Papers