Prog 18 : Write a program to
find area of circle and cone using function overloading
#include <iostream.h>
#include<conio.h>
float area(float r,float
h)
{
return(1/3*(3.14*r*r*h));
}
float area(float c)
{
return(3.14*c*c);
}
void main()
{
clrscr();
cout<<"\nArea of
cone ="<<area(2.3f);
cout<<"\nArea of circle ="<<area(2.3f,5.2f);
getch();
cout<<"\nArea of circle ="<<area(2.3f,5.2f);
getch();
}
No comments:
Post a Comment