Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /* CABEÇALHO
- Arquivo: LISTA 03 - Exercicio 22.c
- Objetivo: Exiba os 50 primeiros numeros da sequencia fibonacci.
- Autor(a): Ramon Borges
- */
- #include <stdio.h>
- int main()
- {
- int i, anterior = 1, atual = 1, aux;
- printf("%d ", anterior);
- for(i = 1; i < 50; i++)
- {
- printf("%d ", atual);
- aux = atual;
- atual += anterior;
- anterior = aux;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment