Expressions Questions and Answers
Practice ModeShowing 10 of 26 questions
Q1
Which of the following is the correct order of evaluation for the below expression?
z = x + y * z / 4 % 2 - 1
Answer: Option A
Q2
Which of the following correctly shows the hierarchy of arithmetic operations in C?
Answer: Option D
Q3
Which of the following is the correct usage of conditional operators used in C?
Answer: Option C
Q4
Which of the following is the correct order if calling functions in the below code?
a = f1(23, 14) * f2(12/4) + f3();
Answer: Option C
Q5
Which of the following are unary operators in C?
1. !
2. sizeof
3. ~
4. &&
Answer: Option D
Q6
In which order do the following gets evaluated
Relational
Arithmetic
Logical
Assignment
Answer: Option A
Q7
What is the result of the expression: 5 + 3 * 2?
Answer: Option B
Explanation: Multiplication has higher precedence than addition, so 3*2=6, then 5+6=11.
Q8
Which of the following is a valid C identifier?
Answer: Option B
Explanation: C identifiers must start with a letter or underscore, and contain only letters, digits, or underscores.
Q9
What is the value of the expression: 10 / 3?
Answer: Option A
Explanation: Integer division truncates the decimal part in C.
Q10
What does the expression: 7 % 2 evaluate to?
Answer: Option A
Explanation: Modulo operator gives the remainder after division.