Mega Code Archive

 
Categories / Ruby / Language Basics
 

Call integer to_s and Interpolation

x = 10 y = 20 puts x.to_s + " + " + y.to_s + " = " + (x + y).to_s puts "#{x} + #{y} = #{x + y}"