package main import "fmt" func main() { sum :=0 n :=0 for{ n++ sum +=n if sum >=3000{ fmt.Printf("n = %d, sum = %d",n,sum) return } } }