This set of C Multiple Choice Questions & Answers (MCQs) focuses on “Precedence and Order of Evaluation – 4”.
Pre-requisite for this C MCQ set: Advanced C Programming Video Tutorial.
1. What will be the output of the following C code?
#include <stdio.h>
void main()
{
int b = 5 - 4 + 2 * 5;
printf("%d", b);
}
a) 25
b) -5
c) 11
d) 16
View Answer
Explanation: None.
2. What will be the output of the following C code?
#include <stdio.h>
void main()
{
int b = 5 & 4 & 6;
printf("%d", b);
}
a) 5
b) 6
c) 3
d) 4
View Answer
Explanation: None.
3. What will be the output of the following C code?
#include <stdio.h>
void main()
{
int b = 5 & 4 | 6;
printf("%d", b);
}
a) 6
b) 4
c) 1
d) 0
View Answer
Explanation: None.
4. What will be the output of the following C code?
#include <stdio.h>
void main()
{
int b = 5 + 7 * 4 - 9 * (3, 2);
printf("%d", b);
}
a) 6
b) 15
c) 13
d) 21
View Answer
Explanation: None.
5. What will be the output of the following C code?
#include <stdio.h>
void main()
{
int h = 8;
int b = (h++, h++);
printf("%d%d\n", b, h);
}
a) 10 10
b) 10 9
c) 9 10
d) 8 10
View Answer
Explanation: None.
6. What will be the output of the following C code?
#include <stdio.h>
void main()
{
int h = 8;
int b = h++ + h++ + h++;
printf("%d\n", h);
}
a) 9
b) 10
c) 12
d) 11
View Answer
Explanation: None.
7. What will be the output of the following C code?
#include <stdio.h>
void main()
{
int h = 8;
int b = 4 * 6 + 3 * 4 < 3 ? 4 : 3;
printf("%d\n", b);
}
a) 3
b) 33
c) 34
d) Run time error
View Answer
Explanation: None.
8. What will be the output of the following C code?
#include <stdio.h>
void main()
{
int a = 2 + 3 - 4 + 8 - 5 % 4;
printf("%d\n", a);
}
a) 0
b) 8
c) 11
d) 9
View Answer
Explanation: None.
9. What will be the output of the following C code?
#include <stdio.h>
void main()
{
char a = '0';
char b = 'm';
int c = a && b || '1';
printf("%d\n", c);
}
a) 0
b) a
c) 1
d) m
View Answer
Explanation: None.
10. What will be the output of the following C code?
#include <stdio.h>
void main()
{
char a = 'A';
char b = 'B';
int c = a + b % 3 - 3 * 2;
printf("%d\n", c);
}
a) 65
b) 58
c) 64
d) 59
View Answer
Explanation: None.
Sanfoundry Global Education & Learning Series – C Programming Language.
To practice all areas of C language, here is complete set of 1000+ Multiple Choice Questions and Answers.
- Practice Computer Science MCQs
- Apply for Computer Science Internship
- Check Computer Science Books
- Check C Books
- Watch Advanced C Programming Videos