#include<stdio.h>
#include<conio.h>
int main()
{
int i,a,b,n,sum=0;
clrscr();
printf("enter the no. of terms");
scanf("%d",&n);
printf("\n enter the starting two terms of the series");
scanf("%d%d",&a,&b);
for(i=1;i<=n;i++)
{
sum=a+b;
a=b;
b=sum;
printf("\n%d",sum);
}
getch();
return 0;
}
0 comments:
Post a Comment