nikolas_serafini

Lista 3 - Exercício 23

Jun 13th, 2013
28
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.25 KB | None | 0 0
  1. int main()
  2. {
  3.     int i,a = 0, b = 1,c ,n;
  4.  
  5.     printf("Entre com o nesimo termo :\n");
  6.     scanf("%d",&n);
  7.    
  8.     for (i = 0; i < n; i++)
  9.     {
  10.         c = a + b;
  11.         a = b;
  12.         b = c;
  13.     }
  14.     printf("%d\n",c);
  15.    
  16.     return 0;
  17. }
Advertisement
Add Comment
Please, Sign In to add comment