title: C#: Multiply an array elements with each other
body: <p>I would like to be able to multiply all members of a given numeric array with each other. </p>
  
  <p>So for example for an array like: <code>[1,2,3,4]</code>, I would like to get the product of <code>1*2*3*4</code>. </p>
  
  <p>I have tried this but didn't work:         </p>
  
  <pre><code>/// &lt;summary&gt;
  /// Multiplies numbers and returns the product as rounded to the nearest 2 decimal places.
  /// &lt;/summary&gt;
  /// &lt;param name="decimals"&gt;&lt;/param&gt;
  /// &lt;returns&gt;&lt;/returns&gt;
  public static decimal MultiplyDecimals(params decimal[] decimals)
  {
     decimal product = 0;
  
     foreach (var @decimal in decimals)
     {
         product *= @decimal;
     }
  
     decimal roundProduct = Math.Round(product, 2);
     return roundProduct;
  }
  </code></pre>
  
  <p>I am sorry I know this must be simple! </p>
  
  <p>Thanks.</p>