Advertisement
Guest User

Untitled

a guest
Nov 15th, 2019
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.49 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <string.h>
  3. #include <math.h>
  4. int main ()
  5. {
  6. int N,x,y;
  7. x = 0;
  8. y = 1;
  9. int i;
  10. int p;
  11.  
  12. printf("enter number of elements you need\n");
  13. scanf("%d",&p);
  14.  
  15. N = x;
  16. x = y;
  17. y = x+N;
  18.  
  19. printf("%d ",x);
  20. printf("%d ",y);
  21. N = y;
  22. y = x + y;
  23. x = N;
  24.  
  25. for(i=0; i<p-2; i++)
  26. {
  27. printf("%d ",y);
  28. N = y;
  29. y = x + y;
  30. x = N;
  31. }
  32.  
  33.  
  34.  
  35.  
  36. } //function main
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement