in Algorithms retagged by
317 views
0 votes
0 votes

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

(a) Half of the product of the 3 consecutive integers

(b) One-third of the product of the 3 consecutive integers

(c) One-sixth of the product of the 3 consecutive integers

(d) None of the above

Solution: Option (c)

in Algorithms retagged by
317 views

1 Answer

0 votes
0 votes