Here is a program which will find the Area of shapes using function overloading.

 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 #include "iostream" #include "conio.h" using namespace std; class measure { public: void shape(int r); void shape(int l,int b); void shape(float t,int d,int e); void shape(long a); void shape(float c, long int g); void shape(double j); void shape(float h, double f); }; void measure::shape(int r) { cout<<"area of the circle is "<<3.14*r*r; } void measure::shape(int l,int b) { cout<<"area of the rectangle is"<>ch; switch(ch) { case 1: cout<<"enter the value of radius of the circle \n"; cin>>r; obj.shape(r); break; case 2: cout<<"enter the sides of rectangle \n"; cin>>l>>b; obj.shape(l,b); break; case 3: cout<<"enter the sides of triangle \n"; cin>>d>>e; obj.shape(0.5,d,e); break; case 4: cout<<"enter the sides of square"; cin>>a; obj.shape(a); break; case 5: cout<<"\nEnter the radius of the cone"; cin>>c; cout<<"\nEnter the height of the cone"; cin>>g; obj.shape(c,g); break; case 6: cout<<"\nEnter the radius"; cin>>b; obj.shape(b); break; case 7: cout<<"\nEnter the radius"; cin>>f; cout<<"\nEnter the height"; cin>>h; obj.shape(h,f); break; default: cout<<"\nThe choice entered is a wrong choice"; } getch(); }

### 12 Responses to “Find the Area of shapes using function overloading”

1. Fausto Cotter

There are several advantages of rug cleansing, not the least of which is that it adds to the wonderful sensation everyone gets from walking barefoot on fresh cleaned up carpetings.
Call today for your personal, professional carpet
cleansing examination and also allow the professionals show you exactly how your residence can seem brand-new once
again via tidy carpetings.

There are several advantages of carpeting cleaning, not the least of which is that it contributes to the excellent sensation everyone receives from walking barefoot on freshly cleaned rugs.
Call today for your individual, specialist carpeting cleansing consultation and also allow the specialists show you how your home can seem brand-new once more via clean carpets.