What will be the output of the following pseudo code? Integer a, b, c, d Set b…

2024

What will be the output of the following pseudo code?

Integer a, b, c, d

Set b = 18, c = 12

a = b – c

for (each c from 1 to a – 1)

b = b + c + 12

b = b/5

d = b + a

end for

c = a + b + c

Print a b c

  1. A.

    5 3 9

  2. B.

    6 14 17

  3. C.

    6 4 14

  4. D.

    6 4 16

Show answer & explanation

Correct answer: D

Correct Answer: Option D Explanation: The loop runs for 5 times; after the 5th iteration, a=6 and b=4. The final output values are 6, 4, 16.

Explore the full course: Coding For Placement