/*write a c program to print the fibbonaci series.*/
# include<stdio.h>
int main()
{
int first=0,second=1,n;
int third,i;
printf("%d\t",first);
printf("%d\t",second);
for(i=0;i<5;i++)
{
third=first+second;
printf("%d\t",third);
first=second;
second=third;
}
}
# include<stdio.h>
int main()
{
int first=0,second=1,n;
int third,i;
printf("%d\t",first);
printf("%d\t",second);
for(i=0;i<5;i++)
{
third=first+second;
printf("%d\t",third);
first=second;
second=third;
}
}
No comments:
Post a Comment