All pastes #183387 Raw Edit

Untitled

public text v1 · immutable
#183387 ·published 2006-09-26 21:36 UTC
rendered paste body
#include <iostream.h>

int main()
{
	int a,b,c;
	int result;
	cout << "Welcome to Zach's Calculator! " << endl;
	cout << "Choose one of the following below" << endl;
	cout << " (1. add" << endl;
	cout << " (2. subtract" << endl;
	cout << " (3. multiply" << endl;
	cout << " (4. divide" << endl;
	cin >> c;
	cout << "Enter your first number please!" << endl;
	cin >> a;
	cout << "Now enter your second number please!" << endl;
	cin >> b;
	cin.ignore();

	if(c == 1){
		result = a+b; }
	if(c == 2){
		result = a-b; }
	if(c == 3){
		result = a*b; }
	if(c == 4){
		result = a/b; }
	
		cout << " The answer is " << result << endl;

		cin.get();
		return 0;
}