FastFoodCoding

Login


Connect with one of the following accounts





Login

Please wait while we redirect...

Views: 91   



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

package main

import "fmt"

func main() {

  var days int
  var seconds int
  fmt.Println("Please enter days:")
  fmt.Scanf("%d", &days)
  seconds = days * 24 * 60 * 60
  fmt.Println(seconds , " Seconds")
}

Output:

Please enter days:
 3
259200  Seconds



On By


Top Tutorials

Top Questions

Top Articles

Top Blogs

Top News