You are on page 1of 1

int main()

{
int fn_2=0, fn_1=1, fn, n, i;

printf("Fibonacci Series Printing Program:\n");


printf("Enter the sequence, n, of the fibonacci number (from 2 to any higher
integer):\n");
scanf(" %d",&n);

printf("\n 0 1 ");

for(i=2; i<=n; i++)


{fn = fn_1 + fn_2;
fn_2 = fn_1;
fn_1 = fn;

printf("%d ", fn);


}

return 0;
}

You might also like