Advertisement
Guest User

Untitled

a guest
Oct 20th, 2019
109
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.50 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3. int main()
  4. {
  5.     float x,y,a,b,c,d;
  6.     cout << "Nhap x: ";
  7.     cin >> x;
  8.     cout << "Nhap y: ";
  9.     cin >> y;
  10.     a=x+y;
  11.     b=x-y;
  12.     c=x*y;
  13.     if (y!=0)
  14.     {
  15.         d=x/y;
  16.         cout << "Tong = " << a << endl;
  17.         cout << "Hieu = " << b << endl;
  18.         cout << "Tich = " << c << endl;
  19.         cout << "Thuong = " << d << endl;
  20.     }
  21.     else
  22.     {
  23.         cout << "Tong = " << a << endl;
  24.         cout << "Hieu = " << b << endl;
  25.         cout << "Tich = " << c << endl;
  26.         cout << "Khong co thuong";
  27.     }
  28.     return 0;
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement