1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45
|
#include <iostream>
using namespace std;
void initialize(int x, int & y);
void funcOne (int number, int & x, int & y);
void printxy (int x, int y);
int main()
{
int number;
int x, y;
double rate, hours;
double amount;
initialize(x, y);
funcOne(number, x, y);
printxy(x, y);
return 0;
}
void initialize(int x, int & y)
{
x = 10;
y = 20;
cout << "x = " << x << endl;
cout << "y = " << y << endl;
}
void funcOne (int number, int & x, int & y)
{
cout << "Enter a number." << endl;
cin >> number;
x = x*2 - y + number;
}
void printxy (int x, int y)
{
cout <<"The new value of x is: " << x << endl;
cout <<"The new value of y is: " << y << endl;
}
|