FIbonacci



Hey guys this is the fibonacci series. But Im having this huge problem.
First of all I want to do the simplest code possible so then I can use
user defined functions and arrays. But this one didnt came out well.
Any suggestions!


#include<stdio.h>
#include<math.h>

int main ()

{
int fib, n;

for(n=0; n<=10; n++)
{

fib=(n-1)+(n-2);
printf("%d \n", fib);

}

return 0;
}

.



Relevant Pages

  • Re: FIbonacci
    ... MARQUITOS51 wrote: ... > Hey guys this is the fibonacci series. ... > First of all I want to do the simplest code possible so then I can use ...
    (comp.lang.c)
  • Re: FIbonacci
    ... > Hey guys this is the fibonacci series. ... > First of all I want to do the simplest code possible so then I can use ... > int fib, n; ... First it starts with 1 and 1, the third element of fibonacci series is the ...
    (comp.lang.c)