#include #include using namespace std; int volume(int); long volume(long,int,int); double volume(double,int); int main() { int v,b,h,h1,choice; long l; double r; cout<<"***************** &&&*********************************************\n\n"; cout<<" PROGRAM TO DEMONSTRATE FUNCTION OVERLOADINGT\n\n"; cout<<"***************** &&&*********************************************"< do { cout<<"\n\n\t\t\tEnter your choice:\n\t\t\t\t1.Volume of cube:\n\t\t\t\t2.Volume of cylinder:\n\t\t\t\t3.Volume of cone:\n\t\t\t\t4.Close"; cin>>choice; switch(choice) { case 1: cout<<"\nEnter value of length of cube:\n\n"; cin>>v; cout<<"\nvolume of Cube:\t"< break; case 2: cout<<"\nEnter value of length,breadth & height of cylinder:\n\n"; cin>>l>>b>>h; cout<<"volume of Cylinder:\t"< break; case 3: cout<<"\nEnter value of radious & height of cone:\n\n"; cin>>r>>h1; cout< cout<<"volume of Cone:\t"< break; case 4: break; default: cout<<"Please Enter choice between 1 to 4:"; } } while(choice<4||choice>4); } int volume(int s) { return(s*s*s); } long volume(long k,int j,int l) { return(k*l*j); } double volume(double d,int a) { return(3.145*d*d*a); }
|
| Author: N.Sakthi Ramalingam | Member Level: Bronze | Revenue Score:   |
hello friend, here the above program. i think you forgot to insert header file for this program. so it created some problem while executing. so please kindly change the program by your well wisher.
|
| Author: Prem Prakash Gupta | Member Level: Bronze | Revenue Score:   |
The header file is include using < and &rt; symbols which are filtered by this website thinking it as html escape characters.
|