Expressions Questions and Answers
Practice ModeShowing 10 of 26 questions
Q21
What is the result of: 4 << 1?
Answer: Option C
Explanation: Left shift multiplies by 2 for each shift position.
Q22
What is: 8 >> 1?
Answer: Option A
Explanation: Right shift divides by 2 for each shift position.
Q23
Which is the ternary operator?
Answer: Option A
Explanation: Ternary operator: condition ? value1 : value2
Q24
What is the result of: sizeof(int)?
Answer: Option D
Explanation: sizeof operator returns size in bytes, typically 4 for int.
Q25
What is: 5.0 / 2?
Answer: Option B
Explanation: Division with float and int results in float.
Q26
What is the value of: 10 + 5 * 2 - 3?
Answer: Option A
Explanation: Follow operator precedence: * before + and -