S sugu Honorable Feb 5, 2013 6 0 10,510 Feb 5, 2013 #1 Hello, how to calculate area and volume of shapes using function overloadig?
Solution S S smeezekitty Feb 5, 2013 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: Code: int cube_volume(int width, int height, int length){ return width*height*length; }
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: Code: int cube_volume(int width, int height, int length){ return width*height*length; }
S smeezekitty Distinguished Sep 11, 2012 6,960 0 18,460 Feb 5, 2013 Solution #2 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: Code: int cube_volume(int width, int height, int length){ return width*height*length; } Upvote 0 Downvote Solution
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: Code: int cube_volume(int width, int height, int length){ return width*height*length; }
S sugu Honorable Feb 5, 2013 6 0 10,510 Feb 5, 2013 #4 hai ......... i need area n volume for diff shapes..... Upvote 0 Downvote
S sugu Honorable Feb 5, 2013 6 0 10,510 Feb 5, 2013 #5 Best answer selected by sugu. Upvote 0 Downvote
S smeezekitty Distinguished Sep 11, 2012 6,960 0 18,460 Feb 5, 2013 #6 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: http://www.tutorialspoint.com/ansi_c/c_operator_types.htm C++ function overloading examples: http://www.learncpp.com/cpp-tutorial/76-function-overloading/ Good luck. Upvote 0 Downvote
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: http://www.tutorialspoint.com/ansi_c/c_operator_types.htm C++ function overloading examples: http://www.learncpp.com/cpp-tutorial/76-function-overloading/ Good luck.