You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
18 lines
522 B
18 lines
522 B
//geometry.go
|
|
package main
|
|
|
|
import (
|
|
"fmt"
|
|
"golang-tutorial/geometry/rectangle" //importing custom package
|
|
)
|
|
|
|
func main() {
|
|
var rectLen, rectWidth float64 = 6, 7
|
|
fmt.Println("Geometrical shape properties")
|
|
/*Area function of rectangle package used
|
|
*/
|
|
fmt.Printf("area of rectangle %.2f\n", rectangle.Area(rectLen, rectWidth))
|
|
/*Diagonal function of rectangle package used
|
|
*/
|
|
fmt.Printf("diagonal of the rectangle %.2f ",rectangle.Diagonal(rectLen, rectWidth))
|
|
} |