Advertisement
pdaogu

Ex1

Sep 24th, 2018
114
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.33 KB | None | 0 0
  1. #include<stdio.h>
  2.  
  3. int main () {
  4.     float a, b, c;
  5.     printf("Nhap vao 3 so a, b, c: ");
  6.     scanf("%f%f%f", &a, &b, &c);
  7.     if (a == 0) {
  8.         if (c-b == 0) printf("Phuong trinh co vo so nghiem.\n");
  9.         else printf("Phuong trinh vo nghiem\n");
  10.     }
  11.     else
  12.         printf("Phuong trinh co mot nghiem duy nhat: %.2f\n", (float)(c-b)/a);
  13.     return 0;
  14. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement