Reginaldojs

exercicio 23,lista 3

Aug 20th, 2012
26
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.40 KB | None | 0 0
  1. #include <stdio.h>
  2. #include<Stdlib.h>
  3. int main()
  4. {
  5.     int n;
  6.     float i,j=1,k=1,l=0;
  7.     printf("Por favor,entre com o n-esimo termo:");
  8.     scanf("%d",&n);
  9.     printf("Pronto,ai esta a sequencia fibonacci com os n termos:\n\n");
  10.     for (i=1;i<=n;i++)
  11.     {
  12.         j=k;
  13.         k=l;
  14.         l=k+j;
  15.         printf("%.0f  ",l);
  16.     }
  17.     printf("\n\n");
  18.     system("pause");
  19.     return(0);
  20. }
Advertisement
Add Comment
Please, Sign In to add comment