title: Finding product of all elements of all sub arrays of an array
body: <p>I am having an array A which is having n elements. I want to find out the multiplication of all the elements in all the sub arrays possible of array A. I am expecting the solution to be implemented with the help of DP. I want to store all the product values in an array B. I am beginner to programming. I have done a lot of google search but i was unable to find the exact solution to my query. Can anybody help me to provide me the logic of the question.
  Example:</p>
  
  <pre><code>A={1,2,3}
  </code></pre>
  
  <p>All possible sub arrays are </p>
  
  <pre><code>{{1},{2},{3},{1,2},{1,3},{2,3},{1,2,3}}
  </code></pre>
  
  <p>so all possible products are </p>
  
  <pre><code>{1,2,3,2,3,6,6} 
  </code></pre>
  
  <p>respectively. </p>
  
  <p>Any help is appreciable. Thanks in advance.</p>