What's New-Given Below
technicalsymposium
technicalsymposium
technicalsymposium

Share Our Page Contents

C++ Lab Codings

C++ Program for funtion overloading.

#include<iostream.h>
#include<conio.h>
int area(int);
int area(int,int);
float area(float,double=3.14);
float area(float,float,float=0.5);
void main()
{
int s,l,b;
float r,bas,h;
clrscr();
cout<<"\n\nAREA OF SQUARE CIRCLE TRIANGLE AND RECTANGLE\n\n";
cout<<"Enter Square,Length,Breadth :";
cin>>s>>l>>b;
cout<<"\nEnter Rec,Base,Height : ";
cin>>r>>bas>>h;
int sqr=area(s);
cout<<"\nThe Area of Square : "<<sqr;
int rect=area(l,b);
cout<<"\nThe Area of Rectangle : "<<rect;
float circle=area(r);
cout<<"\nThe Area of Circle : "<<circle;
float tri=area(bas,h);
cout<<"\nThe Area of Triangle : "<<tri;
getch();
}
int area(int a)
{
return(a*a);
}
int area(int x,int y)
{
return(x*y);
}
float area(float b,double c)
{
return(c*b*b);
}
float area(float a,float b,float c)
{
return(a*b*c);
}

Hosting by Yahoo!

About-Us    Contact-Us    Site-map

©copyright 2009 All rights are reserved to technicalsymposium.com