Program to Generate Fibonacci Series

#include<stdio.h>
#include<conio.h>
    void main()
    {
    int a=0,b=1,c=0,term,i;
    clrscr();
      printf("\nEnter Term");
      scanf("%d",&term);

      for(i=1;i<=term;i++)
      {
       printf("\n%d",c);
       c=a+b;
       b=a;
       a=c;
      }

      getch();
    }

Leave a Reply