Convert Temperature from Fahrenheit to centigrade

The formula to convert temperature from Fahrenheit to Centigrade is as below...

C = ( F - 32 ) * 5 / 9
where C and F are temperature in Centigrade and Fahrenheit in respectively.
package main
import "fmt"
func main() {
var f float32
fmt.Print("Enter the temperature in fahrenheit: ")
fmt.Scan(&f)
c := ( f - 32 ) * 5 / 9
fmt.Printf("Temprature in centigrade: %.2f",c)
}

Comments

Popular posts from this blog

Overview of Go lang

Arrays in C Language

String in golang

Data Types in Go language

Creating your first html page

Say Hello world in Go lang

Installing go lang

Arrays in Go lang

Decision Making in Go lang

Decision Making Statements