// rect5.cpp: calculate the area of a rectangle // The function uses the same identifiers as the invocation #include using namespace std; int Area(int base, int height); //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 base, int height) //uses the same identifiers { return base*height; }