All pastes #550392 Raw Edit

izicalc lmao999

public text v1 · immutable
·published 2007-06-08 12:24 UTC
rendered paste body
#include <iostream>
using namespace std;
int main()
{
    int n;
    int a;
    int b;
    cout << "Enter 1 for addition\n";
    cout << "Enter 2 for subtraction\n";
    cout << "Enter 3 for multiplication\n";
    cout << "Enter 4 for division\n";
    cout << "Your choise:   ";
    cin  >> n; 
    
    if (n==1) {
              cout << "Enter the 1.summand:   ";
              cin  >> a;
              cout << "Enter the 2.summand:   ";
              cin  >> b;
              cout << a << "+" << b << "=" << a+b;
              }
    if (n==2) {
              cout << "Enter the minuend:   ";
              cin  >> a;
              cout << "Enter the subtrahend:   ";
              cin  >> b;
              cout << a << "-" << b << "=" << a-b;
              }
    if (n==3) {
              cout << "Enter the 1.factor:   ";
              cin  >> a;
              cout << "Enter the 2.factor:   ";
              cin  >> b;
              cout << a << "x" << b << "=" << a*b;
              }
    if (n==4) {
              cout << "Enter the dividend:   ";
              cin  >> a;
              cout << "Enter the divisor:   ";
              cin  >> b;
              cout << a << ":" << b << "=" << a/b;
              }
    else {
         cout << "Invalid number";
         }
    system("PAUSE");
    return 0;
}