How to write your name in Ruby?

Published on: 10th Nov 2022 by Chetan Mittal
Categories: programming, examples

Below is a Ruby snippet which asks your name and prints it:-
def print_hi(name)
  puts "Hi, #{name}"
end
print_hi('Chetan Mittal')
#=> prints 'Hi, Tom' to STDOUT.