Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Serie Fibonacci en C


Published on

Published in: Technology, Business

Serie Fibonacci en C

  1. 1. #include <stdio.h> int main(int serie, char** fibonacci){ int n, cont, a = 0, b = 1, c; //variables que se usan printf("Cuantos numeros quieres crear: "); scanf("%d", &n); //preguntamos que cunatos numeros quiere generar printf("0,1,"); for(cont=0; cont<n-2; cont++){ //contador c = a + b; //formula de la serie de fibonacci printf("%d,", c); //imprime el valor a = b; //para que sustituya el valor y vuelva a realizarlo b = c; } printf("n"); return 5; }