Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int main() {
- double x, y;
- char p;
- cout << "\n";
- cout << "---------------------------------- \n";
- cout << "1-st numb : ";
- cin>>x;
- system("cls");
- cout << x << "\n";
- cout << "---------------------------------- \n";
- cout << "sign : ";
- cin >> p;
- system("cls");
- if (p == '+') {
- cout << x << "+ \n";
- cout << "---------------------------------- \n";
- cout << "2-nd numb : ";
- cin >> y;
- system("cls");
- cout << x << "+"<< y<< "="<< x + y<< "\n";
- cout << "---------------------------------- \n";
- cout << "Ez \n\n";
- system("pause");
- }
- else if (p == '-') {
- cout << x << "- \n";
- cout << "---------------------------------- \n";
- cout << "2-nd numb : ";
- cin >> y;
- system("cls");
- cout << x << "-" << y << "=" << x - y << "\n";
- cout << "---------------------------------- \n";
- cout << "Ez \n\n";
- system("pause");
- }
- else if (p == '*') {
- cout << x << "* \n";
- cout << "---------------------------------- \n";
- cout << "2-nd numb : ";
- cin >> y;
- system("cls");
- cout << x << "*" << y << "=" << x * y << "\n";
- cout << "---------------------------------- \n";
- cout << "Ez \n\n";
- system("pause");
- }
- else if (p == '/') {
- cout << x << "/ \n";
- cout << "---------------------------------- \n";
- cout << "2-nd numb : ";
- cin >> y;
- system("cls");
- cout << x << "/" << y << "=" << x / y << "\n";
- cout << "---------------------------------- \n";
- cout << "Ez \n\n";
- system("pause");
- }
- else {
- system("cls");
- cout << "Error";
- system("pause");
- }
- system("pause");
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement