// rect6.cpp. rectangle rewritten using a void function #include using namespace std; void PrintArea(int base, int height); //the area of the rectangle, now a void function int main() { int base; //the base of the rectangle int height; //the height of the rectangle //assign values to base and height base = 5; height = 10; //output the result PrintArea(base, height); system("pause"); return 0; } void PrintArea(int base, int height) { cout << "The area is " << base*height << endl; }