Go for statement print Pyramid using *
package main/*from w ww . ja v a 2 s . c o m*/ import "fmt" func main() { var rows int var k int = 0 rows = 8 for i := 1; i <= rows; i++ { k=0 for space := 1; space <= rows-i; space++ { fmt.Print(" ") } for { fmt.Print("* ") k++ if(k == 2*i-1){ break } } fmt.Println("") } }