Programming / Computing

Fibonacci Series

This program will print the fibonacci series :

 

0,1,1,2,3,5,8,13,21,34 ......................................................................................................................................

 

 

#include<stdio.h>

#include<conio.h>

 

void main()

{

int i , a, b ,c,v ;

   v = 0;

printf("the the no. of fibonacii numbers u want to print");

scanf("%d",&v);

a = 0;

b = 1;

 

printf("\n%d",a);

printf("\n%d",b);

 

for (i=0 ; i<=v ; i++)

{

c = a+b;

printf("\n%d",c);

a = b;

b = c;

}

}

 

© 2010 All rights reserved.

Make a free websiteWebnode