How to calculate the surface area of sphere in Go

1 Answer

0 votes
package main

import (
    "fmt"
    "math"
)

func main() {
    var radius float32 = 12.0

    surfaceArea := 4.0 * math.Pi * (radius * radius)

    fmt.Printf("The surface area of Sphere = %f\n", surfaceArea)
}




/*
run:

The surface area of Sphere = 1809.557373

*/

 



answered Nov 19, 2024 by avibootz

Related questions

1 answer 100 views
1 answer 100 views
1 answer 111 views
1 answer 108 views
1 answer 159 views
1 answer 115 views
...