Калькулятор с пасхалкой

← разместить еще код

Простейший Калькулятор

Расшаренный код:

#include "stdafx.h"
#include <iostream>
using namespace std;

int main() {
	int x;
	int y;
	int action;

	cout << "Calculator by BuddyValera V 0.1 \n\n";

	cout << "Enter Numbers: ";

	cin>>x;
	cin>>y;
	cin>>action;


	if (action == 1) {							//adiction//
		int sum = x + y;

		cout << "\n";

		cout<<"The addition is: "<<sum<<endl;
	}

	if (action == 2) {							//subtraction//
		int subtraction = x - y;

		cout << "\n";

		cout<<"Subtraction is: "<< subtraction<<endl;
	}

	if (action == 3) {							//multiplication//
		int multiplication = x * y;				

		cout << " \n";

		cout<<"Multiplication is: "<<multiplication<<endl;

	}