Sun Jan 08, 2012 9:09 am
Thu Jan 12, 2012 8:13 pm
/*fibannoic seriesi*/
main()
{
int f1=1,f2=1,terms,f3,i;
clrscr();
printf("enter the number of terms u want in series \n");
scanf("%d",&terms);
printf("%d %d ",f1,f2);
for(i=0; i<terms-2 ;i++)
{
f3=f1+f2;
printf(" %d ",f3);
f1=f2;
f2=f3;
}
getch();
}
Sat Jan 14, 2012 6:49 pm
#include<stdio.h>
#include<conio.h>
void main()
{
int a=0,b=1,c,i;
clrscr();
printf("%d\t%d",a,b);
for(i=1;i<=8;i++)
{
c=a+b;
printf("%d\t",c);
a=b;
b=c;
}
getch();
}
Codemiles.com is a participant in the Amazon Services LLC Associates Program, an affiliate advertising program designed to provide a means for sites to earn advertising fees by advertising and linking to Amazon.com
Powered by phpBB © phpBB Group.