//
#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, oswitch;
char *stng;
cout << "Please input an integer: ";
cin >> num1;
cout << "Plese input a second integer: ";
cin >> num2;
cout << "Please choose 1 of these 3 options:\n 1. Difference of your 2 numbers\n 2. Quotient of your 2 numbers\n 3. Remainder of two numbers."
cin >> oswitch;
switch (oswitch)
{
case 1: // do these if expr == c1
*stng = diff(int num1, int num2);
case 2:
*stng = quot(int num1, int num2);
case 3:
*stng = rmain(int num1, int num2);
}
cout << *stng;
system("PAUSE");
}
No comments:
Post a Comment