Can someone tell me how the series is to be implemented in c
1,1,1 2,1 2 3,1 2 3 4 5, 1 2 3 4 5 6 7 8
here is my code
but i am not able to get the answer
#include<stdio.h>
int i,n1=0,n2=1,n3,n;
void main()
{
printf("\n Enter Value Of N \n");
scanf("%d",&n);
printf("%-2d",n1);
for(i=0;i<=n;i++)
fib(n);
}
int fib(int n)
{
n1=0,n2=1;
printf("%-2d",n1);
for(i=0;i<n;i++)
{
n3=n1+n2;
n1=n2;
n2=n3;
printf("%-2d",n3);
}
}