title: rub program to read numbers accepting from the user
body: <p>I just started learning ruby and I was trying out a simple program to accept two numbers from the user and multiplying.</p>
  
  <p>Here is my code:</p>
  
  <pre><code>def mult(i1,i2)
          res = i1.to_i * i2.to_i
          puts res
  end
  
  puts "enter 1st no to multiply"
  
  i1 = gets
  
  puts "enter 2nd no to multiply"
  
  i2 = gets
  
  mult(i1,i2)
  </code></pre>
  
  <p>Here I am reading two numbers through <strong>gets</strong> which is accepting as strings and later I am converting into integer as shown in the code.</p>
  
  <p>But is there any way to accept directly as numbers datatype?</p>