Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- int main()
- {
- float i,a=1,b=1,c=0,n;
- printf("Digite o valor de n para descobrir o n-esimo termo da sequencia de Fibonacci: ");
- scanf("%f",&n);
- for (i=1;i<=n;i++)
- {
- a=b;
- b=c;
- c=b+a;
- }
- printf("%.0f\n",c);
- return(0);
- }
Advertisement
Add Comment
Please, Sign In to add comment