title: Ruby: How to multiply several numbers?
body: <p>I am trying to multiply any number of unknown arguments together to make a total.</p>
  
  <pre><code> def multiply(*num)
    num.each { |i| puts num * num}
    end
  
  multiply(2,3,4)
  multiply(2,3,4,5,6,7)
  </code></pre>
  
  <p><strong>Another attempt:</strong></p>
  
  <pre><code>def multiply(num)
    num.to_i
     i = 0
     while i &lt; num.length
     total = num * num
  
      return total
     end
  end
  
  multiply(2,3,4)
  multiply(2,3,4,5,6,7)
  </code></pre>
  
  <p>I keep running into errors: 
  (eval):73: undefined local variable or method `num_' for main:Object (NameError)
      from (eval):81</p>
  
  <p>Some saying that Array needs to be Integer.</p>
  
  <p>I've tried doing something I thought was suppose to be very simple program to write.</p>