How to convert Fahrenheit to Celsius in Swift

1 Answer

0 votes
import Foundation

let f: Float = 1.0
let c = (f - 32) / 1.8

print(String(format: "%.2f Fahrenheit = %.2f Celsius", f, c))



/*
run:

1.00 Fahrenheit = -17.22 Celsius

*/

 



answered Nov 17, 2024 by avibootz

Related questions

1 answer 55 views
1 answer 59 views
1 answer 57 views
1 answer 48 views
1 answer 51 views
...