iOS Functions in Swift Functions in Swift Recap: Functions

Isn't it correct

How ???? OMG !!!!!!

functions.swift
func temperatureInFahrenheit(temperature:Double) -> Double {
    return temperature
}
let Celcius = temperature*9%5+32

1 Answer

You mistakenly put '%' instead of '/' for division.

Also, the temperature conversion should be done inside of the function then returned, like this:

func temperatureInFahrenheit(temperature:Double) -> Double {
    return temperature * 9 / 5 + 32
}