Ruby program to convert hours to minutes

Views: 138   

Following program shows you how to convert hours to minutes.
In this program we get hours from user once we get those we need to multiply with 60 so that we get in minutes

 puts "Please enter hours:"
 hours = gets.to_i
 minutes = hours * 60
 puts "#{minutes} Minutes"

Output:

Please enter hours:
3
180 Minutes
On By