retagged by
414 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)

retagged by

1 Answer

Related questions

0 votes
0 votes
2 answers
1
Mak Indus asked Nov 10, 2018
285 views
Given an array of distinct integers A[1, 2,…n]. Find the tightest upper bound to check the existence of any index i for which A[i]= i.(a) O (1) ...
5 votes
5 votes
1 answer
3
0 votes
0 votes
2 answers
4
Sk Jamil Ahemad asked Feb 1, 2022
347 views
Please explain with some example that How Right to Left associativity takes place in case of Ternary operators?