Consider the following pseudo code. What is the total number of…

PYQ GATE 2014

Consider the following pseudo code. What is the total number of multiplications to be performed?

D = 2
for i = 1 to n do
    for j = i to n do
        for k = j + 1 to n do
            D = D * 3
  1. A.

    Half of the product of the 3 consecutive integers.

  2. B.

    One-third of the product of the 3 consecutive integers.

  3. C.

    One-sixth of the product of the 3 consecutive integers

  4. D.

    None of the above.

Attempted by 170 students.

Sign up free to check your answer

Sign up free

Explore the full course: Zero To Hero

Loading lesson…