Go Program to find the area of a circle: This Go program gets radius as user inputs and computes the area of a circle.
Go Program to Find Area of a Circle
package main
import (
"fmt"
"math"
)
func main() {
var radius int
var area float32
fmt.Println("Finds area of circle")
fmt.Println("--------------------")
fmt.Print("Enter radius: ")
fmt.Scanf("%d", &radius)
area = math.Pi * (float32(radius) * float32(radius))
fmt.Printf("Circle Area: %.2f\n", area)
}
Output of Program