Fibonacci series program in c language


#include<stdio.h>
#include<conio.h>

void main()
{
  int i,a=0,b=1,c,n;
  clrscr();
  printf("Enter the limits:");
  scanf("%d",&n);
  for(i=1;i<=n;i++)
  {
    printf("%d ",a);
    c=a+b;
    a=b;
    b=c;
  }
  getch();
}

Comments

Post a Comment

Popular posts from this blog

program that compresses windows BMP image file using java

react-native multiselect dropdown