Skip to content
This repository was archived by the owner on Oct 7, 2023. It is now read-only.

Created v5cgZN.go #1557

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions HjOamA/v5cgZN.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
package main

import (
"fmt"
)

func parallelogramArea(base, height float64) float64 {
return base * height
}

func main() {
var base, height float64

// Get user input for base and height
fmt.Print("Enter the base of the parallelogram: ")
fmt.Scan(&base)

fmt.Print("Enter the height of the parallelogram: ")
fmt.Scan(&height)

// Calculate the area
area := parallelogramArea(base, height)

// Display the result
fmt.Printf("The area of the parallelogram with base %.2f and height %.2f is %.2f\n", base, height, area)
}