logo image

Go language program to convert millimeters into centimeters

Views: 15

Following program shows you how to convert millimeters into 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

package main

import "fmt"

func main() {

  var millimeters float64
  var centimeters float64
  fmt.Println("Please enter millimeters:")
  fmt.Scanf("%f", &millimeters)
  centimeters = millimeters / 10
  fmt.Println(centimeters , " Centimeters")


Please enter millimeters:
5.2  Centimeters