Spot and fix the mistake

Report a typo

The Go program below has a syntax error. Can you identify it and fix the code so the program compiles and runs properly?

Sample Input 1:

100

Sample Output 1:

665.15
Write a program in Go
package main

import "fmt"

type Temperature = float64

// nolint: gomnd // DO NOT remove this comment!
func (t Temperature) CelsiusToFahrenheit() Temperature {
return t*9/5 + 32
}

// nolint: gomnd // DO NOT remove this comment!
func (t Temperature) FahrenheitToKelvin() Temperature {
return t + 273.15
}

func (t Temperature) AddTemperature(other Temperature) Temperature {
return t + other
}

func main() {
var t1 Temperature
fmt.Scan(&t1)

t2 := t1.AddTemperature(t1)
t3 := t2.CelsiusToFahrenheit()
t4 := t3.FahrenheitToKelvin()
fmt.Println(t4)
}
___

Create a free account to access the full topic