Choose the correct output of the following Python program snippet: D = 11 B, E…

PYQ EMRS TGT/PGT (ESSE) 2025

Choose the correct output of the following Python program snippet:

D = 11
B, E = 0, 1
while D > 0:
    R = D % 2
    D //= 2
    B += R * E
    E *= 10
print(B)
  1. A.

    1011

  2. B.

    1101

  3. C.

    1001

  4. D.

    1100

Attempted by 899 students.

Sign up free to check your answer

Sign up free

Explore the full course: Emrs Cs Tier 2

Loading lesson…