Skip to content

Instantly share code, notes, and snippets.

@samueltcsantos
Created February 28, 2022 20:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save samueltcsantos/060fc652d71aa610b7d480bc4865b674 to your computer and use it in GitHub Desktop.
Save samueltcsantos/060fc652d71aa610b7d480bc4865b674 to your computer and use it in GitHub Desktop.
Calculando a área do circulo dado o valor do raio em Go
// https://pkg.go.dev/math#pkg-functions
package main
import (
"fmt"
"math"
)
func main() {
var raio, area float64
fmt.Print("Digite o raio: ")
fmt.Scan(&raio)
area = math.Pi * math.Pow(raio, 2);
fmt.Println("Area é ", math.Round(area))
}
@samueltcsantos
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment