Share

Search Java Code Snippets


  Help us in improving the repository. Add new snippets through 'Submit Code Snippet ' link.





Java - Code Samples

 Sample 1. Write a program to print fibonacci series.

int count = 15;
int[] fibonacci = new int[count];
fibonacci[0] = 0;
fibonacci[1] = 1;
for(int x=2; x < count; x++){
   fibonacci[x] = fibonacci[x-1] + fibonacci[x-2];
}

for(int x=0; x< count; x++){
   System.out.print(fibonacci[x] + " ");
}

   Like      Feedback     fibonacci



Subscribe to Java News and Posts. Get latest updates and posts on Java from Buggybread.com
Enter your email address:
Delivered by FeedBurner



comments powered by Disqus