# Ruby program for to_r function # Initializing the number
num1 =51
num2 =10.78
num3 =1690.89
num4 =183# Prints the number as rational
puts num1.to_r
puts num2.to_r
puts num3.to_r
puts num4.to_r
# Ruby program for to_r function # Initializing the number
num1 =312
num2 =98.09
num3 =190.23
num4 =2.5# Prints the number as rational
puts num1.to_r
puts num2.to_r
puts num3.to_r
puts num4.to_r