// rect4.cpp: calculate the area of a rectangle // Rewritten to use a function #include using namespace std; int Area(int b, int h); //the area of the rectangle, now a 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 cout << "The area is " << Area(base, height) << endl; system("pause"); return 0; } int Area(int b, int h) { return b*h; }