title: How do i find all possible sums of N elements in an array?
body: <p>I'm looking for advice on how to find all possible sums of N elements. For example, I have an array</p>
  <p><code>int []arr={91,58,89,87,25,65,21};</code></p>
  <p>For some <code>int n=3;</code></p>
  <p>I need to find all possible sums of 3 elements in this array. In the beginning, it looked easy for me as I would find all sums of subarrays of size 3 but I am not sure  of subsequences of size 3 .
  I found similar questions on Google and the solution was to use recursion. I'm not sure I really understand how to solve this one with my conditions, hope you could give me an advise and example so I could solve this one! I'm not sure my initial code is need since it works linearly.</p>
  <p>Thank you in advance.</p>