/* The Fibonacci sequence is defined by the following rule. The fist two values in the sequence are 1 and 1. Every subsequent value is the run of the two values preceding it. Write a Java program that uses non recursive functions to print the Fibonacci sequence. */ public class Fibonacci { public static void main(String args[]) { int a=0, b=1,n,counter,c; n=10; System.out.println("FIBONACCI SERIES"); System.out.println(a+" "+b); for(counter = 2; counter < = n; counter++) { c=a + b; System.out.println(c); a=b; b=c; } } } // End of Class Output FIBONACCI SERIES 0 1 1 2 3 5 8 13 21 34 55