#include<stdio.h>
int main()
{
    int a=0,b=1,s=0,i=0,n,sum=1;

    scanf("%d",&n);
     printf("%d ,%d ,",a,b);
    while(i<n-2){     /// 2 ta pod age thekei cilo(first and second pod)

        s=a+b;
        a=b;
        b=s;
        i++;
        sum=sum+s;
        printf("%d ,",s);
    }
    printf("\n%d ,",sum);      /// nth position fibo
    return 0;
}

Embed on website

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