• S
    SwaseekhGATE Preparation
General
  • Dashboard
  • Syllabus
  • Questions
  • Aptitude
  • Mock Tests
  • TCS NQT 2026
Account
  • Pricing
  • Contact
  1. GATE CS
  2. PYQs
  3. General Aptitude

The expression (x + y - |x - y|) / 2 is equal to: A. The maximum of x and y B. The minimum of x and y C. (x + y + |x - y|) / 2 D. None of the above

GATE 2017 · General Aptitude · Absolute Value · medium

Answer: B. The minimum of x and y. The expression (x + y - |x - y|) / 2 = min(x, y).

  1. Case 1: x >= y: E = (x + y - (x - y)) / 2 = (x + y - x + y) / 2 = 2y / 2 = y. Since x >= y, y = min(x, y).
  2. Case 2: x < y: E = (x + y - (y - x)) / 2 = (x + y - y + x) / 2 = 2x / 2 = x. Since x < y, x = min(x, y).
  3. Combine both cases: In all cases, (x + y - |x - y|) / 2 = min(x, y). Therefore option B is correct.