Program to find area of rectangle and circle using Function Overloading


    #include <iostream.h>
    float area (float, float);                  // prototypes
    float area (float);
    void main( )
    {
        cout << "Area of a rectangle = " << area(1.5, 3.6);
        cout << "\nArea of a circle  = " << area(2.5) << "\n";
    }
    float area(float length, float width)    // Definition - 1
    {
        return(length * width);
    }
    float area(float radius)                // Definition - 2
    {
        return(3.142 * radius * radius);
    }

2 comments:

Anonymous said...

great publish, very informative. I'm wondering why the opposite specialists of this sector do not notice this. You should proceed your writing. I am confident, you've a
great readers' base already!

Take a look at my web blog; diet That works

Anonymous said...

The coloring pages at Crayola.com are ideal for children as young as 2 years old up-to about 11 years old.

This Christmas, surprise your kids with these simple
homemade Holiday gifts.

Also visit my blog - http://xp5.net/

Post a Comment

 
 
 
 


Copyright © 2012 http://codeprecisely.blogspot.com. All rights reserved |Term of Use and Policies|