# Go – Program to calculate area of Rectangle and Square

Here, We are going to write a program to calculate area of Rectangle and Square in go golang. Area of rectangle is multiplication of length and breadth i.e length * breadth whereas area of Square is square of length i.e length * length.

Algorithm:

• Get the length and breadth of rectangle
• Calculate the area of rectangle by multiplying length and breadth
• Calculate the area of square by squaring the length

Example with code:

```package main

import "fmt"

func main(){

var length, breadth = 3, 4

var area int

fmt.Println("Area of Rectangle : ", area)

area = length * length

fmt.Print("Area of Square : ", area)

}
```

Output:

`Area of Rectangle :  12Area of Square : 9`

`https://www.techieindoor.com/go-lang-tutorial/`

References:

`https://golang.org/doc/https://golang.org/pkg/`
Posted in golang

1. agen vivoslot terpercaya

My brother suggested I might like this blog. He was entirely right.
This post actually made my day. You cann’t imagine just how much time I
had spent for this info! Thanks!

• techieindoor

2. • 