Given that π‘₯ = 7.5, 𝑗 = βˆ’1.0, 𝑛 = 1.0, π‘š = 2.0 the value of…

2015

Given thatΒ π‘₯ = 7.5, 𝑗 = βˆ’1.0, 𝑛 = 1.0, π‘š = 2.0Β 

the value ofΒ βˆ’βˆ’π‘₯+𝑗==π‘₯>𝑛>=π‘šΒ is:

  1. A.

    0

  2. B.

    1

  3. C.

    2

  4. D.

    3

Attempted by 443 students.

Show answer & explanation

Correct answer: A

Interpretation: In a Python-like expression, a == b > c >= d means (a == b) and (b > c) and (c >= d). Also, the token --x is unary minus applied twice, so --x = x.

  • Compute the left side: --x + j. Since --x = x = 7.5 and j = -1.0, --x + j = 7.5 + (-1.0) = 6.5.

  • Evaluate each comparison in the chain using x = 7.5, n = 1.0, m = 2.0:

    • 6.5 == 7.5 β†’ False

    • 7.5 > 1.0 β†’ True

    • 1.0 >= 2.0 β†’ False

  • Combine the results: False and True and False β†’ False.

  • Final numeric representation: False corresponds to 0.

Answer: 0

Explore the full course: Mppsc Assistant Professor