// function prototypes void AnotherShellGame(int& x, int& y, int& z); void G(int N, int& M); void main() { //Problem 1---------------------- cout << "Problem 1" << endl; int A = 3, B = 5, C = 7; AnotherShellGame(A, B, C); cout << A << B << C << endl; AnotherShellGame(B, C, A); // Note the order of the arguments cout << A << B << C << endl; AnotherShellGame(A, B, C); cout << A << B << C << endl; cout << endl; //Problem 2---------------------- cout << "Problem 2" << endl; int P = 8, Q = 20; cout << "P = " << P << " Q = " << Q << endl; G(P, Q); cout << "P = " << P << " Q = " << Q << endl; G(P, Q); cout << "P = " << P << " Q = " << Q << endl; cout << endl; //Problem 3---------------------- cout << "Problem 3" << endl; int AA[6]; for (int J = 0; J < 6; J++) AA[J] = J*J; for (int J = 0; J < 6; J++) cout << AA[J] << " "; cout << endl; for (int J = 5; J > 0; J--) AA[J] = AA[J] - AA[J-1]; for (int J = 0; J < 6; J++) cout << AA[J] << " "; cout << endl;} // end main void AnotherShellGame(int& x, int& y, int& z) { int t = x; if (x > y) if (z > x) y = z; else x = z; if (y > z) x = y; else z = y; y = t; } void G(int N, int& M){ N = N / 2; M = M / 2; cout << "N = " << N << " M = " << M << endl; }