Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- int main()
- {
- int a,b,c,i,n;
- printf("Enter number of terms: ");
- scanf("%d",&n);
- a = 0;
- b = 1;
- c = 0;
- for(i=1; i<=n; i++)
- {
- printf("%d ",c);
- a = b;
- b = c;
- c = a + b;
- }
- return 0;
- }
Add Comment
Please, Sign In to add comment