This set of C Multiple Choice Questions & Answers (MCQs) focuses on “Arithmetic Operators – 2”.
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 a = 3;
int b = ++a + a++ + --a;
printf("Value of b is %d", b);
}
a) Value of b is 12
b) Value of b is 13
c) Value of b is 10
d) Undefined behaviour
View Answer
Explanation: None.
2. What is the precedence of arithmetic operators (from highest to lowest)?
a) %, *, /, +, –
b) %, +, /, *, –
c) +, -, %, *, /
d) %, +, -, *, /
View Answer
Explanation: None.
3. Which of the following is not an arithmetic operation?
a) a * = 10;
b) a / = 10;
c) a ! = 10;
d) a % = 10;
View Answer
Explanation: None.
4. Which of the following data type will throw an error on modulus operation(%)?
a) char
b) short
c) int
d) float
View Answer
Explanation: None.
5. Which among the following are the fundamental arithmetic operators, i.e, performing the desired operation can be done using that operator only?
a) +, –
b) +, -, %
c) +, -, *, /
d) +, -, *, /, %
View Answer
Explanation: None.
6. What will be the output of the following C code?
#include <stdio.h>
int main()
{
int a = 10;
double b = 5.6;
int c;
c = a + b;
printf("%d", c);
}
a) 15
b) 16
c) 15.6
d) 10
View Answer
Explanation: None.
7. What will be the output of the following C code?
#include <stdio.h>
int main()
{
int a = 10, b = 5, c = 5;
int d;
d = a == (b + c);
printf("%d", d);
}
a) Syntax error
b) 1
c) 10
d) 5
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.
- Watch Advanced C Programming Videos
- Check Computer Science Books
- Practice Computer Science MCQs
- Apply for Computer Science Internship
- Apply for C Internship