Advertisement
Hiteshw11

Multiplication using method with return in ruby

Sep 25th, 2018
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 0.18 KB | None | 0 0
  1. def multiply(a,b)
  2.    return a*b
  3. end
  4.  
  5. puts "Enter the first number"
  6. first=gets.chomp()
  7. puts "Enter the second number"
  8. second=gets.chomp()
  9. puts multiply(first.to_i,second.to_i)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement