#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();
}
One of the most astonishing old town on the planet Old City of Jerusalem
-
Jerusalem is perhaps the most established city on the planet . By measuring
its history and its multifaceted nature, on the off chance that we think
about ...
Hace 5 años
0 comentarios:
Publicar un comentario