Back To Java Loops Index
//program to print first 1 to 10 terms of fibonicci series using while statement public class whilefibo { public static void main(String[] args) { int a,b,c,i; a=1; b=1; i=2; System.out.println(a); System.out.println(b); while(i<=10) { c=a+b; System.out.println(c); a=b; b=c; i++; } } }