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