print "Enter a string: " s = gets print "Enter an integer: " i = gets.to_i # If string entered, will return zero puts "String = #{s}" puts "Integer = #{i}"