Go for statement Generate Fibonacci Sequence Number
package main//from w w w . jav a2s. c o m import "fmt" func main(){ var n int t1:=0 t2:=1 nextTerm:=0 n = 7 fmt.Print("Fibonacci Series :") for i:=1;i<=n;i++ { if(i==1){ fmt.Print(" ",t1) continue } if(i==2){ fmt.Print(" ",t2) continue } nextTerm = t1 + t2 t1=t2 t2=nextTerm fmt.Print(" ",nextTerm) } }