Advertisement
Guest User

Untitled

a guest
Jul 19th, 2018
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.30 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <math.h>
  3.  
  4. int main()
  5. {
  6. float a, b, c;
  7. scanf("%f", &a);
  8. scanf("%f", &b);
  9. scanf("%f", &c);
  10.  
  11. double d,x1,x2;
  12. d=(b*b)-4*a*c;
  13. if (d>0) {
  14. x1=(-b+sqrt(d))/(2*a);
  15. x2=(-b-sqrt(d))/(2*a);
  16. printf("x1=%f",x1);
  17. printf("x2=%f",x2);
  18. }
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement