Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- int main()
- {
- int n,a,b,i,F;
- a=1;
- printf("n= ");
- scanf("%d",&n);
- if(n==0)
- {
- printf("F(%d)=%d",n,a);
- }
- else
- {
- if(n==1)
- {
- printf("F(%d)=%d",n,a);
- }
- else
- {
- i=2;
- b=1;
- F=0;
- do
- {
- F=a+b;
- a=b;
- b=F;
- i++;
- }
- while(i<=n);
- printf("le %d ieme terme de cette suite est %d",n,F);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement