Expressions Questions and Answers

Practice Mode
Showing 10 of 26 questions
Q21
What is the result of: 4 << 1?
  • A 2
  • B 4
  • C 8
  • D 5
Answer: Option C
Explanation: Left shift multiplies by 2 for each shift position.
Q22
What is: 8 >> 1?
  • A 4
  • B 8
  • C 16
  • D 0
Answer: Option A
Explanation: Right shift divides by 2 for each shift position.
Q23
Which is the ternary operator?
  • A ?:
  • B ??
  • C ::
  • D !!
Answer: Option A
Explanation: Ternary operator: condition ? value1 : value2
Q24
What is the result of: sizeof(int)?
  • A 2
  • B 4
  • C 8
  • D Depends on compiler
Answer: Option D
Explanation: sizeof operator returns size in bytes, typically 4 for int.
Q25
What is: 5.0 / 2?
  • A 2
  • B 2.5
  • C 2.0
  • D 3
Answer: Option B
Explanation: Division with float and int results in float.
Q26
What is the value of: 10 + 5 * 2 - 3?
  • A 17
  • B 12
  • C 27
  • D 22
Answer: Option A
Explanation: Follow operator precedence: * before + and -
Questions and Answers for Competitive Exams Various Entrance Test