Archive for the ‘ Programming ’ Category

Fibonacci number Series In Java


Simple Java Program for Fibonacci Number series
I’ve not programming a lot ever since. Here is my simple program about Fibonacci Number Series.
It’s kinda dumb, but its basic. haha.,,,,, No interesting topic to do…

————————————————————
public class Fibonacci {
public static int fib(int n) {
if (n < 2) {
return n;
}
else {
return fib(n-1)+fib(n-2);
}
}

public static void main(String[] args) {
for (int i=0; i<=46; i++)
System.out.println(fib(i)+", ");
}

}
————————————————————————

Advertisements