Skip to content

Commit

Permalink
Created v5cgZN.go
Browse files Browse the repository at this point in the history
Created Go program for finding area of parallelogram .
closes SourceFusionHub#1554 

Signed-off-by: Ritish Srivastava <[email protected]>
  • Loading branch information
Ritish134 authored Oct 7, 2023
1 parent dcde273 commit f4068b8
Showing 1 changed file with 26 additions and 0 deletions.
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)
}

0 comments on commit f4068b8

Please sign in to comment.