How to calculate the surface area of sphere in Swift

1 Answer

0 votes
import Foundation

let radius: Float = 12.0

let surfaceArea = 4.0 * Float.pi * (radius * radius)

print("The surface area of Sphere = \(surfaceArea)")



/*
run:

The surface area of Sphere = 1809.5573

*/

 



answered Nov 19, 2024 by avibootz

Related questions

1 answer 110 views
1 answer 110 views
1 answer 107 views
1 answer 84 views
1 answer 159 views
1 answer 115 views
...