Data Structures & AlgorithmsHardTCS NQT · Infosys

Evaluate the integer expression 2*(3+4) - 5/(1+1) with integer division (truncation toward zero). What is the result?

  1. A. 12
  2. B. 13
  3. C. 14
  4. D. 16

Correct answer: A. 12

Brackets first: 2*7 = 14 and 5/2 = 2 with integer division, so 14 - 2 = 12.

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

Exams that ask this topic