Advertisement
Hiteshw11

Method with parameters in ruby

Sep 25th, 2018
108
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 0.17 KB | None | 0 0
  1. def welcome(name,age)
  2.   puts ("Welcome "+name+" Your age is "+age.to_s)
  3. end
  4.  
  5. puts "Enter your name"
  6. n1=gets.chomp()
  7. puts "Enter your age"
  8. a1=gets.chomp()
  9. welcome(n1,a1)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement