public class fibonacci{
       public static void main(String args[]){
         double n0=0;
         double n1=1;
         for(int x=0;x<10;x++){
            double y=n0+n1;
            n0=n1;
            n1=y;
            System.out.println((y)+" ");
         }
      }
   }

Comentários