Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<iostream>
- int find_area(int len, int wid) //function declaration
- {
- int area;
- area = len*wid;
- return area; //returning the result
- }
- int main(void)
- {
- int length, width, area;
- cout<<"Enter the length and width of the rectangle: "<<endl;
- cin>>length;
- cin>>width;
- area = find_area(length, width); //calling the function and getting the value back
- cout<<"The area of the rectangle is " << area;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement