Active Members
TodayLast 7 Daysmore...


Program To Demonstrate Function Overloading in C++ PProgramming


Posted Date:     Total Responses: 0    Posted By: Nilesh Ganpati Patil   Member Level: Bronze   Points/Cash: 4   


#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);
}


Project Feedbacks

Author: Member Level: BronzeRevenue Score: 2 out of 52 out of 5
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: Member Level: BronzeRevenue Score: 2 out of 52 out of 5
The header file is include using < and &rt; symbols which are filtered by this website thinking it as html escape characters.


Post Feedback
You must Sign In to post a feedback.
Next Project: Dealer Book Management System using C++
Previous Project: To find the ascorbic acid content of citrus fruits

Return to Project Index

Post New Project


Related Projects

Awards & Gifts
ISC Technologies, Kochi - India. Copyright © All Rights Reserved.