//fibonacci series
#include <stdio.h>

int main() {
    int a=1,b=1,n,i,c;
    printf("Enter the number till fibonacci series : ");
    scanf("%d",&n);
    if(n==1){
        printf("1 ");
    }else if(n==2){
        printf("\n%d",a);
    }else{
        printf("\n%d, %d ,",a,b);
        i=2;
        while(i<=n){
            c=a+b;
            printf("%d, ",c);
            a=b;
            b=c;
            i++;
        }
    }
    return 0;
}

Embed on website

To embed this project on your website, copy the following code and paste it into your website's HTML: