GO Program to find area and circumference of circle
This simple GO language program is Calculating the area and circumference of the circle. This is an example how we use float64 and constant declaration.
Example
package main
import "fmt"
func main(){
var rad float64
const PI float64 = 3.14 // Constant
var area float64
var ci float64
fmt.Print("Enter radius of Circle : ")
fmt.Scanln(&rad)
area = PI * rad * rad
fmt.Println("Area of Circle is : ",area)
ci = 2 * PI * rad
fmt.Println("Circumference of Circle is : ",ci)
}
Most Helpful This Week
Missing return at end of function error in Golang
Example: How to use ReadFull from IO Package in Golang?
Go program to find CNAME record of a domain
Different ways for Integer to String Conversions
How do you catch panic in Golang?
Golang program for implementation of Selection Sort
Golang read file line by line to string
How do you handle HTTP Client server load balancing in Go?
GO Program to Find the Largest Number Among Three Numbers
Golang program for implementation of Merge Sort