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

String in golang

Arrays in C Language

Literals in Java

Pointers in C Language

Inline V/S Block Level Element

Reserved Words in Java

Identifiers

Data Types in Go language

Printing in C programming

Variable Naming & Scope of Variable