#include
int main()
{
int area,triangle,side,base,height;
char ch;
printf(“Enter s for area and t for triangle:”);
scanf(“%c”,&ch);
switch(ch)
{
case ‘s’:
printf(“Enter side:”);
scanf(“%d”,&side);
area=side*side;
printf(“Area of square = %dm^2\n”,area);
break;
case ‘t’:
printf(“Enter base and hight:”);
scanf(“%d%d”,&base,&height);
area=(base*height)/2;
printf(“Area of triangle =%dm^2\n”,area);
}
}