logo image

Go language program to convert hours to minutes

Views: 13

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

package main

import "fmt"

func main() {

  var hours int
  var minutes int
  fmt.Println("Please enter hours:")
  fmt.Scanf("%d", &hours)
  minutes = hours * 60
  fmt.Println(minutes , " Minutes")


Please enter hours:
300  Minutes