C program for shapes to calculate area and volume using function overloading

how to calculate area and volume of shapes using function overloadig?
5 answers Last reply Best Answer
More about program shapes calculate area volume function overloading
  1. Best answer
    Missing lots of details here.

    What sort of shape?
    "Overloading" is a function of C++ not C

    for example if you want to get the volume of a cube:
    int cube_volume(int width, int height, int length){
        return width*height*length;
  2. hai .........
    i need area n volume for diff shapes.....
  3. Best answer selected by sugu.
  4. It is really quite easy. Just look up the area and volume formula of the shapes on google and perform the math is C or C++.

    Volume of pyramid is (Base * height) / 3
    Area of triangle is (base * 0.5) * height

    Area of rectangle is width*height

    Other shape formulas can be found easily and be implemented like above.

    C operators:

    C++ function overloading examples:

    Good luck.
Ask a new question

Read More

Windows 7