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