#include<iostream.h>
#include<conio.h>
#include<math.h>
void main()
{
clrscr();
float l,b,r,d,s,h;
int ch;
cout<<"1.Area of square\n";
cout<<"2.Area of rectangle\n";
cout<<"3.Area of triangle\n";
cout<<"4.Area of circle\n";
cout<<"choose the polygon whose area is to be calculated\n";
cin>>ch;
switch(ch)
{
case 1:
cout<<"enter the lenght of side\n";
cin>>s;
d=pow(s,2);
cout<<"the area of square is\n"<<d;
break;
case 2:
cout<<"enter the lenght and breadth respectively\n";
cin>>l;
cin>>b;
d=l*b;
cout<<"the area of rectangle is\n"<<d;
break;
case 3:
cout<<"enter the lenght of base and height respectively\n";
cin>>b;
cin>>h;
d=0.5*b*h;
cout<<"the area of triangle is\n"<<d;
break;
case 4:
cout<<"enter the radius\n";
cin>>r;
d=3.14*r*r;
cout<<"the area of circle is\n"<<d;
break;
default:
cout<<"the entered choice is invalid";
break;
}
getch();
}