Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<stdio.h>
- #include<stdlib.h>
- #include<math.h>
- int main()
- {
- float x, xf, t, y;
- printf("Digite o valor inicial: ");
- scanf("%f", &x);
- printf("Digite o valor final: ");
- scanf("%f", &xf);
- printf("Digite o intervalo: ");
- scanf("%f", &t)
- if(x>xf && t>0)
- printf("\n\nValor inicial deve ser menor do que Valor final!!\n");
- else
- {
- for( ; x <= xf ; x+=t)
- {
- y = pow(x,2) + 2*x + 1;
- printf("valor Y: %f", y);
- printf(" e o valor X: %f\n\n", x);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement