ramontricolor12

LISTA 03 - Exercício 22

Jun 28th, 2013
50
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.42 KB | None | 0 0
  1. /* CABEÇALHO
  2.    Arquivo: LISTA 03 - Exercicio 22.c
  3.    Objetivo: Exiba os 50 primeiros numeros da sequencia fibonacci.
  4.    Autor(a): Ramon Borges
  5.  */
  6.  
  7. #include <stdio.h>
  8. int main()
  9. {
  10.     int i, anterior = 1, atual = 1, aux;
  11.  
  12.     printf("%d  ", anterior);
  13.     for(i = 1; i < 50; i++)
  14.     {
  15.         printf("%d  ", atual);
  16.         aux = atual;
  17.         atual += anterior;
  18.         anterior = aux;
  19.     }
  20.     return 0;
  21. }
Advertisement
Add Comment
Please, Sign In to add comment