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