Thursday, 24 May 2012

/* ******** program in c for Fibonacci series********* */
#include<stdio.h>
#include<conio.h>
main()
{
 int a=1,b=1;
 int n, c=0;
 printf("enter the range of fibinnocci series  to enter\n");
 scanf("%d",&range);
 printf(" The fibinocci series is");
 printf("\n%d %d ",a,b);
 while(c<=range)
   {
     c=b+a;
     a=b;
     b=c;
    printf("%d" %d ",a,b);
   }
}




No comments:

Post a Comment