Advertisement
nguyenhappy92

Giải phương trình ax+b=0

Oct 6th, 2015
213
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.33 KB | None | 0 0
  1. // Giai phuong trinh ax + b=0
  2. // Khai bao thu vien
  3. #include<stdio.h>
  4. #include<conio.h>
  5.  
  6. void main()
  7. {
  8. int a,b;
  9. scanf("%d%d",&a,&b);
  10.  
  11. if(a==0)
  12. {
  13. if(b==0)
  14. {
  15. printf(" PT co nghiem tuy y");
  16. }
  17. else
  18. {
  19. printf("PT vo nghiem");
  20. }
  21. }
  22. else
  23. {
  24. printf("PT co nghiem duy nhat: %.2f", (float)-b/a);
  25. }
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement