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, x, y, d;
- printf("digite o A, o B e o C: ");
- scanf("%f %f %F", &a, &b, &c);
- d = pow(b, 2) -4*a*c;
- x = (-b + sqrt(d))/(2*a);
- y = (-b - sqrt(d))/(2*a);
- if(a == 0) {
- x = -b/c;
- printf("isso eh de primerio grau, x eh: %.2f", x);
- }
- if(d < 0) printf("\nisso non exciste!");
- else{
- printf("\nos resultados sao: %.2f %.2f", x, y);
- }
- }
Add Comment
Please, Sign In to add comment