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

Arrays in C Language

Pointers in C Language

String in golang

Literals in Java

Reserved Words in Java

Identifiers

Data Types in Go language

Variable Naming & Scope of Variable

Overview of Go lang

Functions in C Language