Thursday, January 22, 2015

Java Program with Looping



A Java Program with Looping

class Fibonacci
{
public static void main(String[] args)
{
       int lo = 1;
       int hi = 1;
       System.out.println(lo);
       while (hi < 50)
{
      System.out.print(hi);
      hi = lo + hi;
      lo = hi - lo;

   }
}

No comments:

Post a Comment