Go language program to convert days to hours

Views: 156   

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

package main

import "fmt"

func main() {

  var days int
  var hours int
  fmt.Println("Please enter days:")
  fmt.Scanf("%d", &days)
  hours = days * 24
  fmt.Println(hours , " Hours")


Please enter days:
120  Hours
On By