C Write Program Create Function Find Area Rectangle Use Overloading Provide Calculating Re Q37081232

C++

Write a program that will create a a function to find the arearectangle. Use overloading to provide for calculating real andinteger values.


Solution


#include <iostream>using namespace std;int area(int length, int width) { return length * width;}double area(double length, double width) { return length * width;}int main() { cout << area(2, 4) << endl; cout << area(5.4, 2.5) << endl; return 0;}

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.