Write a Go program to print the K shape alphabets pattern using for loop.
package main
import "fmt"
func main() {
var i, j, row, alphabet int
fmt.Print("Enter the K Shape Alphabets Pattern Rows = ")
fmt.Scanln(&row)
fmt.Println("**** K Shape Alphabets Pattern ****")
for i = row - 1; i >= 0; i-- {
alphabet = 65
for j = 0; j <= i; j++ {
fmt.Printf("%c ", alphabet+j)
}
fmt.Println()
}
for i = 1; i < row; i++ {
alphabet = 65
for j = 0; j <= i; j++ {
fmt.Printf("%c ", alphabet+j)
}
fmt.Println()
}
}
For more star pattern examples, please refer to the Go Star Pattern programs article.

Also Visit
- Go Program to Print Repeated Characters Pattern
- Go Program to Print Right Triangle Alphabets Pattern