13:05 ET Dow -154.48 at 10309.92, Nasdaq -37.61 at 2138.44, S&P -19.130 1 100001 0 1 0 1 1 0 1 0 00 0 1 1 1 0 1 100001 0 1 1 100001 0 1 100001 0 1 0 1 1 0 1 0 00 0 1 1 1 0 1 100001 0 1 1 100001 0 1 100001 0 1 0 1 1 0 1 0 00 0 1 1 1 0 1 100001 0 1 1 100001 0 1 100001 0 1 0 1 1 0 1 0 00 0 1 1 1 0 1 100001 0 1 1 100001 0 1 100001 0 1 0 1 1 0 1 0 00 0 1 1 1 0 1 100001 0 1 1 100001 0 1 100001 0 1 0 1 1 0 1 0 00 0 1 1 1 0 1 100001 0 1 1 100001 0 1 100001 0 1 0 1 1 0 1 0 00 0 1 1 1 0 1 100001 0 1 1 100001 0 1 100001 0 1 0 1 1 0 1 0 00 0 1 1 1 0 1 100001 0 1 1 100001 0 1 100001 0 1 0 1 1 0 1 0 00 0 1 1 1 0 1 100001 0 1 1 100001 0 1 100001 0 1 0 1 1 0 1 0 00 0 1 1 1 0 1 100001 0 1 1 100001 0 1 100001 0 1 0 1 1 0 1 0 00 0 1 1 1 0 1 100001 0 1 1 100001 0 1 100001 0 1 0 1 1 0 1 0 00 0 1 1 1 0 1 100001 0 1 1 100001 0 1 100001 0 1 0 1 1 0 1 0 00 0 1 1 1 0 1 100001 0 1 1 100001 0 1 100001 0 1 0 1 1 0 1 0 00 0 1 1 1 0 1 100001 0 1 1 100001 13:05 ET Dow -154.48 at 10309.92, Nasdaq -37.61 at 2138.44, S&P -19.1313:05 ET Dow -154.48 at 10309.92, Nasdaq -37.61 at 2138.44, S&P -19.13

.

.

Wednesday, October 14, 2009

Here is the working code: c++

// mit_assign_3.cpp : Defines the entry point for the console application.
//

#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