C Programming

Fibonacci Series

In mathematics, the Fibonacci numbers are the following sequence of numbers:
0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, . . .

Language : C

For more programs on Fibonacci Series refer to the following:

[sourcecode language='c']
//Fibonacci Series
#include
void main()
{
int i,a,b,n,N;

printf(“Enter value for N : “);
scanf(“%d”, &N);
a=0;
b=1;
n=a+b;
printf(“\nThe fibonacci series is : “);
printf(“\n %d \t %d”,b,b);
for(i=0;i {
a=b;
b=n;
n=a+b;

printf(“\t%d”, n);
}

}

[/sourcecode]



Leave a Comment

Notify me of followup comments via e-mail. You can also subscribe without commenting.


WordPress - Vaibhav Kanwal