AllInfoHub Logo

AllInfoHub – MCQ Practice

Operators and Expressions – Multiple Choice Questions (MCQs)

  1. 37. Which operator has the highest precedence among the following: +, *, ==, &&?

    • A. +
    • B. *
    • C. ==
    • D. &&
  2. 38. Which operator has the lowest precedence among the following: =, +, *, !?

    • A. =
    • B. +
    • C. *
    • D. !=
  3. 39. What is the associativity of the arithmetic operators (+, -, *, /)?

    • A. Left-to-right
    • B. Right-to-left
    • C. Depends on the operands
    • D. Not applicable
  4. 40. What is the associativity of the assignment operator (=)?

    • A. Left-to-right
    • B. Right-to-left
    • C. Depends on the operands
    • D. Not applicable
  5. 41. What is a compound assignment operator in C?

    • A. An operator that performs two operations at once
    • B. An operator that works on complex data types
    • C. An operator with high precedence
    • D. An operator used in loops
  6. 42. Which of the following is a valid compound assignment operator in C?

    • A. ++
    • B. --
    • C. ==
    • D. +=
  7. 43. What is the value of the expression `(2 + 3) * 4`?

    • A. 8
    • B. 14
    • C. 20
    • D. 24
  8. 44. What is the value of the expression `2 + 3 * 4`?

    • A. 14
    • B. 20
    • C. 8
    • D. 24
  9. 45. Which operator is the ternary operator in C?

    • A. if-else
    • B. switch-case
    • C. ?
    • D. while
  10. 46. What is the syntax of the ternary operator in C?

    • A. condition ? true_value : false_value
    • B. if condition then true_value else false_value
    • C. condition : true_value ? false_value
    • D. true_value if condition else false_value
  11. 47. What is the value of the expression `(5 > 2) ? 10 : 20`?

    • A. 10
    • B. 20
    • C. 5
    • D. 2
  12. 48. What is the value of the expression `(5 < 2) ? 10 : 20`?

    • A. 10
    • B. 20
    • C. 5
    • D. 2