Data Structures & AlgorithmsHardTCS NQT · Infosys

Evaluate 3 + 5 * 2 - 8 / 4 using standard precedence and integer division. What is the result?

  1. A. 11
  2. B. 12
  3. C. 13
  4. D. 15

Correct answer: A. 11

Multiplication and division come first: 5 * 2 = 10 and 8 / 4 = 2, so 3 + 10 - 2 = 11. Evaluating strictly left to right gives 2.

More Arrays, Strings, Linked Lists, Stacks, Queues and Hashing questions

Exams that ask this topic