Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <math.h>
- int main()
- {
- float a, b, c, delta, raizPos, raizNeg;
- printf("\nInforme os 3 coeficientes da equacao: ");
- scanf("%f %f %f", &a, &b, &c);
- //Processamento
- delta = pow(b,2.0) - (4.0*a*c);
- if(delta > 0)
- {
- raizPos = (-b + sqrt(delta)) / (2.0*a);
- raizNeg = (-b - sqrt(delta)) / (2.0*a);
- printf("\nRaiz 1 : %f \n Raiz 2 : %f \n", raizPos, raizNeg);
- }
- else
- printf("\nSem raizes reais.\n");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment