Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<stdio.h>
- int main()
- {
- int n,first=0,second=1,count=0,fibo;
- printf("Enter the number:");
- scanf("%d", &n);
- while (count<n)
- {
- if (count<=1)
- {
- fibo=count;
- }
- else
- {
- fibo=first+second;
- first=second;
- second=fibo;
- }
- printf("%d ", fibo);
- count=count+1;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement