//
#include "stdafx.h"
#include
#include "math.h"
using namespace std;
int diff(int num1, int num2)
{
int diffnums;
diffnums = num1 - num2;
return diffnums;
}
int quot(int num1, int num2)
{
int quotnums;
quotnums = num1 / num2;
return quotnums;
}
int rmain(int num1, int num2)
{
int rmains;
rmains = num1 % num2;
return rmains;
}
int _tmain(int argc, _TCHAR* argv[])
{
int num1, num2;
int oswitch;
float dg;
int stng;
int rm;
cout << "Please input an integer: ";
cin >> num1;
cout << "Plese input a second integer: ";
cin >> num2;
cout << "1. Difference of two numbers" << endl
<< "2. Quotient of two numbers" << endl
<< "3. Remainder of two numbers" << endl
<< "Enter your choice:";
cin >> oswitch;
switch(oswitch)
{
case 1:
cout << "Difference is " << diff(num1, num2) << endl;
break;
case 2 :
cout << "Quotient is " << quot(num1, num2) << endl;
break;
case 3 :
cout << "Remainder is " << rmain(num1, num2) << endl;
break;
}
system("PAUSE");
}
No comments:
Post a Comment