#include "stdio.h"
#include "conio.h"
main()
{
clrscr();
int num,a=0,b=1,i,c;
printf("Sucesion de Fibonacci:\n");
printf("Numero hasta el cual calcular (0 para infinito):"); scanf("%d",&num);
printf("%d,",a); printf(" %d, ",b);
if (num==0)
{
for (i=1;i>=0;i++)
{
c=a+b;
if (c>0)
{
printf("%d, ",c);
a=b;
b=c;
}
}
printf("\nSe calcula hasta el limite de la Maquina...");
}
else
for (i=1;i<=num;i++)
{
c=a+b;
if (c<num)
{
printf("%d, ",c);
a=b;
b=c;
}
}
getch();
}
A Greek town with natural aquifers on the sea shore Therma Ikaria
-
On the Greek island of Ikaria there isn't just quietness, life span (it is
one of the longest-lived spots on earth), communities, and shrouded sea
shores t...
Hace 4 años