Saturday, 9 March 2019

CPP-EX22


 Write a C++ program to calculate area of cone,sphere and circle by    using function overloading.

#include<iostream.h>

#include<conio.h>

int area(int,int);

int area(int);

float area(float);

int main()

{

int radius,side;

float r;

clrscr();

cout<<"\n***********Calculating Area of Cone,Sphere and Circle:";

cout<<"\nEnter the radius:";

cin>>radius;

cout<<"\nEnter the side of the cone:";

cin>>side;

area(radius,side);

cout<<"\n1.Area of Cone:"<<area(radius,side);

area(radius);

cout<<"\n2.Area of Sphere:"<<area(radius);

cout<<"\nEnter the radius of circle:";

cin>>r;

area(r);

cout<<"\n3.Area of Circle:"<<area(r);

getch();

return 0;

}