#include<iostream>
using namespace std;
const float pi=3.14;
float area(float n,float b,float h)
{
float ar;
ar=n*b*h;
cout<<"The area of Triangle : "<<ar<<endl<<endl;
}
float area(float r)
{
float ar;
ar=pi*r*r;
cout<<"The area of Circle : "<<ar<<endl<<endl;
}
float area(float l,float w)
{
float ar;
ar=l*w;
cout<<"The area of Rectangle :"<<ar<<endl;
}
int main()
{
float b,h,r,l,w;
cout<<"Enter the Base & Hieght of Triangle : ";
cin>>b>>h;
area(0.5,b,h);
cout<<"Enter the radius of circle :";
cin>>r;
area(r);
cout<<"Enter the Lenght & width of Rectangle: ";
cin>>l>>w;
area(l,w);
return 0;
}
using namespace std;
const float pi=3.14;
float area(float n,float b,float h)
{
float ar;
ar=n*b*h;
cout<<"The area of Triangle : "<<ar<<endl<<endl;
}
float area(float r)
{
float ar;
ar=pi*r*r;
cout<<"The area of Circle : "<<ar<<endl<<endl;
}
float area(float l,float w)
{
float ar;
ar=l*w;
cout<<"The area of Rectangle :"<<ar<<endl;
}
int main()
{
float b,h,r,l,w;
cout<<"Enter the Base & Hieght of Triangle : ";
cin>>b>>h;
area(0.5,b,h);
cout<<"Enter the radius of circle :";
cin>>r;
area(r);
cout<<"Enter the Lenght & width of Rectangle: ";
cin>>l>>w;
area(l,w);
return 0;
}
No comments:
Post a Comment