#include <stdio.h>
int fibanocci(int
n)
{
int a, b, c, top;
a=1; b=1; c=0;
top=1;
do
{
top+=b;
c=a+b;
a=b;
b=c;
}
while (b<=n);
printf("toplam=%d ",
top);
}
main()
{
int
nn=15;
/* printf("son sayiyi gir :");
scanf("%d",
&nn);*/
fibanocci(nn);
getch();
}
Hiç yorum yok:
Yorum Gönder