Program to print the formula of Area of Geometric figure
#include <iostream.h>
#include <conio.h>
int
main()
{
cout<<"Enter
any index number of following Shape \n \n1-Circle \n \n2- Rectangle \n
\n3-Triangle \n \n4-Parallelogram \n";
char
fig;
cin>>fig;
switch(fig)
{
case '1':
cout<<"Circle= pi*r*r";
break;
case '2':
cout<<"Rectangle= LxW" ;
break;
case '3':
cout<<"Triangle=BxH/2" ;
break;
case '4':
cout<<"Parallelogram= BxH";
break;
default:
cout<<("Unknown Choice");
}
getch();
return 0;
}
No comments :
Post a Comment