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 x1,x2,a,b,c;
- printf("Entre com os coeficientes de uma equacao de segundo grau : \n"); scanf("%f %f %f",&a,&b,&c);
- x1 = (-b + sqrt(pow(b,2) - 4*a*c)) / (2*a);
- x2 = (-b - sqrt(pow(b,2) - 4*a*c)) / (2*a);
- printf("Primeira raiz = %f\nSegunda raiz = %f",x1,x2);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment