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 127 views
1 answer 134 views
1 answer 131 views
1 answer 117 views
1 answer 124 views
1 answer 122 views
1 answer 104 views
...