|
|
 |
|
|
|
|
{
int temp; // Temporary holding variable
// Save value of first parameter
temp = firstValue;
// Shift values of next two parameters
firstValue = secondValue;
secondValue = thirdValue;
// Replace value of final parameter with saved value
thirdValue = temp;
} |
|
|
|
 |
|
|
|
|
#include <iostream.h>
void Rotate( int&, int&, int& );
int main()
{
int int1; // First input value
int int2; // Second input value
int int3; // Third input value
cout << Enter three values: ;
cin >> int >> int2 >> int3;
cout << Before: << int1 << << int2 <<
<< int3 << endl;
Rotate(int1, int2, int3);
cout << After: << int1 << << int2 <<
<< int3 << endl;
return 0;
}
// The Rotate function, as above, goes here |
|
|
|
|
|
|
|
|
Chapter 7
Case Study Follow-Up |
|
|
|
|
|
|
|
|
2. void PrintData( /* in */ int deptID,
/* in */ int storeNum,
/* in */ float deptSales )
{
cout << setw(12) << Dept << deptID << endl;
|
|
|
|
|
|