Write a Go program to print the same numbers on all sides of a square pattern using for loop.
package main import "fmt" func main() { var i, j, k, row int fmt.Print("Enter Sqaure With All Sides Same Number Rows = ") fmt.Scanln(&row) fmt.Println("Same Number on All Sides of a Square Pattern") for i = 1; i <= row; i++ { for j = 1; j <= row; j++ { if i < j { fmt.Printf("%d ", row-i+1) } else { fmt.Printf("%d ", row-j+1) } } for k = row - 1; k >= 1; k-- { if i < k { fmt.Printf("%d ", row-i+1) } else { fmt.Printf("%d ", row-k+1) } } fmt.Println() } for i = row - 1; i > 1; i-- { for j = 1; j <= row; j++ { if i < j { fmt.Printf("%d ", row-i+1) } else { fmt.Printf("%d ", row-j+1) } } for k = row - 1; k >= 1; k-- { if i < k { fmt.Printf("%d ", row-i+1) } else { fmt.Printf("%d ", row-k+1) } } fmt.Println() } }