Friday 23 September 2016

Series Program : 1 3 8 15 27 50 92 169 311

1 3 8 15 27 50 92 169 311
void main()
{
int a=1, b=3, c=4, n=10, sum, i;
printf("%d %d ",a,b,c);
for(i=4; i<=n; i++)
{
sum = a+b+c;
printf("%d ",sum);
a = b;
b = c;
c = sum;
}
}

No comments:

Post a Comment

Featured post

The Thrill of Programming: Exploring the Satisfaction Behind the Code

Different individuals find satisfaction in programming for various reasons. Here are some common factors that tend to bring satisfaction to ...