top of page
Wave
Cactus%20Plant_edited.jpg

FIBONACCI SERIES

#include<stdio.h>
int main()
{
    int n,a,b,y;
    printf("Enter the upper limit : ");
    scanf("%d",&n);
    a=0;
    b=1;
    y=1;
    printf("\nThe fibonacci numbers are : ");
    if(n>0)
        printf("%d",a);
    while(y<n)
    {
        printf(", %d",y);    
        y=a+b;
        a=b;
        b=y;
    }
    printf(".\n");    
    return 1;
}

Subscribe Form

Thanks for submitting!

  • Facebook
  • YouTube
  • Instagram
  • Twitter

©2020 by Abhisek Midya ( A18 )

bottom of page