Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <string.h>
- #include <math.h>
- int main ()
- {
- int N,x,y;
- x = 0;
- y = 1;
- int i;
- int p;
- printf("enter number of elements you need\n");
- scanf("%d",&p);
- N = x;
- x = y;
- y = x+N;
- printf("%d ",x);
- printf("%d ",y);
- N = y;
- y = x + y;
- x = N;
- for(i=0; i<p-2; i++)
- {
- printf("%d ",y);
- N = y;
- y = x + y;
- x = N;
- }
- } //function main
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement