#include<stdio.h>
int main()
{
int n,i,a,b,c,anik;
printf("Enter any number : ");
scanf("%d",&n);
a = 0;
b = 1;
c = 1;
for(i=1;i<=n;i++)
{
printf("%d ",a);
anik = a + b + c;
a = b;
b = c;
c = anik;
}
return 0;
}
int main()
{
int n,i,a,b,c,anik;
printf("Enter any number : ");
scanf("%d",&n);
a = 0;
b = 1;
c = 1;
for(i=1;i<=n;i++)
{
printf("%d ",a);
anik = a + b + c;
a = b;
b = c;
c = anik;
}
return 0;
}
Comments
Post a Comment