//Sample Program to generate the Fibanacci terms 
#include < stdio.h >
#include < conio.h >
void main()
  {
  int a,b,c,terms,count;
  clrscr();
  printf("\n  Enter the number of terms: ");
  scanf("%d",&terms);
  a=0;
  b=1;
  printf("\n  Fibanacci terms are \n");
  printf("\n   %d \n",a);
  printf("\n   %d \n",b);
  count=2;
  while(count < terms)
    {
    c=a + b;
    printf("\n   %d \n",c);
    a=b;
    b=c;
    count++;
    }
  getch();
  }
<< GO BACK

Our aim is to provide information to the knowledge seekers. 


comments powered by Disqus
Natural



Footer1