Ruby program to convert millimeters to centimeters

Views: 100   

Following program shows you how to convert millimeters to centimeters.
In this program we get millimeters from user, once we get those we need to divide with 10 so that we get in centimeters

 puts "Please enter millimeters:"
 millimeters = gets.to_f
 centimeters = millimeters / 10
 puts "#{centimeters} Centimeters"

Output:

Please enter millimeters:
25
2.5 Centimeters
On By