From 7c32e57e8a2f97209f76a99c16e21bc8e25bfb16 Mon Sep 17 00:00:00 2001 From: Amit Anand <140126906+Amitanand0123@users.noreply.github.com> Date: Sat, 7 Oct 2023 14:22:10 +0530 Subject: [PATCH] Create NBQ0u9.go Signed-off-by: Amit Anand <140126906+Amitanand0123@users.noreply.github.com> --- UvZdZL/NBQ0u9.go | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 UvZdZL/NBQ0u9.go diff --git a/UvZdZL/NBQ0u9.go b/UvZdZL/NBQ0u9.go new file mode 100644 index 0000000..1fb9da9 --- /dev/null +++ b/UvZdZL/NBQ0u9.go @@ -0,0 +1,19 @@ +package main + +import ( + "fmt" + "math" +) + +func cylinderVolume(radius float64, height float64) float64 { + volume := math.Pi * math.Pow(radius, 2) * height + return volume +} + +func main() { + radius := 5.0 + height := 10.0 + + volume := cylinderVolume(radius, height) + fmt.Printf("The volume of the cylinder with radius %.2f and height %.2f is %.2f\n", radius, height, volume) +}