int a=1; int b=0; int c=1; while(c<1000){ c=a+b; a=b; b=c; if(c<1000) { System.out.print(c + "\t"); } }