Temperature Converter

Convert Celsius to Fahrenheit using variables and Printf.

package main

import "fmt"

func main() {
	celsius := 30.0
	fahrenheit := celsius*9/5 + 32

	fmt.Printf("%.1f°C = %.1f°F\n", celsius, fahrenheit)
}
▶ Open Go Playground

Copy the code above and paste to run

© 2026 ByteLearn.dev. Free courses for developers. · Privacy