title: Number of multiplications in a pseudo code
body: <p>Consider the following pseudo code. What is the total number of multiplications to be performed?</p>
  
  <pre><code>D = 2
  for i = 1 to n do
     for j = i to n do
        for k = j + 1 to n do
             D = D * 3 
  </code></pre>
  
  <p>Well I came across this question while learning to figure out complexity of algorithms.
  How can one go about solving these types of questions its easy to say it has a upper bound of O(n^3) but how to find out exact number of multiplications.</p>