CALCULATE SUM OF FIBONACCI SERIES UP TO A GIVEN TERMS


#include<stdio.h>
#include<conio.h>
void main()
{
int num1=0, num2=1, num3, n, term;
printf("Enter number terms to printf");
scanf("%d",&n);
printf("0 1");
for(term = 3; term <= n; term++)
{
num3 = num1 + num2;
printf(" %d",num3);
num1 = num2;
num2 = num3;
}
}

2 comments: (+add yours?)

Anonymous said...

Nice dude keep it up..

Unknown said...

Very informative article.Thank you author for posting this kind of article .

http://www.wikitechy.com/view-article/Fibonacci-series-program-in-cpp


Both are really good,
Cheers,
Venkat

Post a Comment