250+ TOP MCQs on Precedence and Order of Evaluation and Answers

C helps anyone preparing for Wipro and other companies C interviews. One should practice these Objective Questions and answers continuously for 2-3 months to clear Wipro interviews on C Programming language.

Here is a listing of C programming Objective Questions on “Precedence and Order of Evaluation” along with answers, explanations and/or solutions:

1. What will be the output of the following C code?

  1.     #include 
  2.     void main()
  3.     {
  4.         int b = 5 - 4 + 2 * 5;
  5.         printf("%d", b);
  6.     }

a) 25
b) -5
c) 11
d) 16
Answer: c
Clarification: None.

2. What will be the output of the following C code?

  1.     #include 
  2.     void main()
  3.     {
  4.         int b = 5 & 4 & 6;
  5.         printf("%d", b);
  6.     }

a) 5
b) 6
c) 3
d) 4
Answer: d
Clarification: None.

3. What will be the output of the following C code?

  1.     #include 
  2.     void main()
  3.     {
  4.         int b = 5 & 4 | 6;
  5.         printf("%d", b);
  6.     }

a) 6
b) 4
c) 1
d) 0
Answer: a
Clarification: None.

4. What will be the output of the following C code?

  1.     #include 
  2.     void main()
  3.     {
  4.         int b = 5 + 7 * 4 - 9 * (3, 2);
  5.         printf("%d", b);
  6.     }

a) 6
b) 15
c) 13
d) 21
Answer: b
Clarification: None.

5. What will be the output of the following C code?

  1.     #include 
  2.     void main()
  3.     {
  4.         int h = 8;
  5.         int b = (h++, h++);
  6.         printf("%d%dn", b, h);
  7.     }

a) 10 10
b) 10 9
c) 9 10
d) 8 10
Answer: c
Clarification: None.

6. What will be the output of the following C code?

  1.     #include 
  2.     void main()
  3.     {
  4.         int h = 8;
  5.         int b = h++ + h++ + h++;
  6.         printf("%dn", h);
  7.     }

a) 9
b) 10
c) 12
d) 11
Answer: d
Clarification: None.

7. What will be the output of the following C code?

  1.     #include 
  2.     void main()
  3.     {
  4.         int h = 8;
  5.         int b = 4 * 6 + 3 * 4 < 3 ? 4 : 3;
  6.         printf("%dn", b);
  7.     }

a) 3
b) 33
c) 34
d) Run time error
Answer: a
Clarification: None.

8. What will be the output of the following C code?

  1.     #include 
  2.     void main()
  3.     {
  4.         int a = 2 + 3 - 4 + 8 -  5 % 4;
  5.         printf("%dn", a);
  6.     }

a) 0
b) 8
c) 11
d) 9
Answer: b
Clarification: None.

9. What will be the output of the following C code?

  1.     #include 
  2.     void main()
  3.     {
  4.         char a = '0';
  5.         char b = 'm';
  6.         int c = a && b || '1';
  7.         printf("%dn", c);
  8.     }

a) 0
b) a
c) 1
d) m
Answer: c
Clarification: None.

10. What will be the output of the following C code?

  1.     #include 
  2.     void main()
  3.     {
  4.         char a = 'A';
  5.         char b = 'B';
  6.         int c = a + b % 3 - 3 * 2;
  7.         printf("%dn", c);
  8.     }

a) 65
b) 58
c) 64
d) 59
Answer: d
Clarification: None.

Leave a Reply

Your email address will not be published. Required fields are marked *