Advertisement
Spocoman

08. Circle Area and Perimeter

Sep 15th, 2024
152
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Go 0.22 KB | None | 0 0
  1. package main
  2. import (
  3.     "fmt"
  4.     "math"
  5. )
  6.  
  7. func main() {
  8.     var r float64
  9.     fmt.Scanln(&r)
  10.  
  11.     var area = math.Pi * r * r
  12.     var perimeter = 2 * math.Pi * r
  13.  
  14.     fmt.Printf("%.2f\n%.2f", area, perimeter)
  15. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement