===========================================================================
CODING
#include<iostream.h>
#include<conio.h>
#include<math.h>
void main()
{
int n,d1,d2,r,a,h,p1,p2,Ar;
clrscr();
cout<<"\nQ)Want To Find Area??";
cout<<"\n Circle[1]";
cout<<"\n Trapezium[2]";
cout<<"\n Rhombus[3]";
cout<<"\n Square[4]";
cout<<"\n\nWhat type of fig. are you finding:-";
cin>>n;
switch(n)
{
case 1:
cout<<"\n Enter Radius of Circle: ";
cin>>r;
Ar=3.14*pow(r,2);
cout<<"\n Area= "<<Ar; break;
case 2:
cout<<"\n Enter Height: ";
cin>>h;
cout<<"\n Enter Parallel sides: ";
cin>>p1>>p2;
Ar=0.5*h*(p1+p2);
cout<<"\n Area= "<<Ar; break;
case 3:
cout<<"\n Enter Diagonals: ";
cin>>d1>>d2;
Ar=0.5*d1*d2;
cout<<"\n Area= "<<Ar; break;
case 4:
cout<<"\n Enter Side: ";
cin>>a;
Ar=pow(a,2);
cout<<"\n Area= "<<Ar; break;
default: cout<<"Wrong input!!!!";
}
getch();
}
CODING
#include<iostream.h>
#include<conio.h>
#include<math.h>
void main()
{
int n,d1,d2,r,a,h,p1,p2,Ar;
clrscr();
cout<<"\nQ)Want To Find Area??";
cout<<"\n Circle[1]";
cout<<"\n Trapezium[2]";
cout<<"\n Rhombus[3]";
cout<<"\n Square[4]";
cout<<"\n\nWhat type of fig. are you finding:-";
cin>>n;
switch(n)
{
case 1:
cout<<"\n Enter Radius of Circle: ";
cin>>r;
Ar=3.14*pow(r,2);
cout<<"\n Area= "<<Ar; break;
case 2:
cout<<"\n Enter Height: ";
cin>>h;
cout<<"\n Enter Parallel sides: ";
cin>>p1>>p2;
Ar=0.5*h*(p1+p2);
cout<<"\n Area= "<<Ar; break;
case 3:
cout<<"\n Enter Diagonals: ";
cin>>d1>>d2;
Ar=0.5*d1*d2;
cout<<"\n Area= "<<Ar; break;
case 4:
cout<<"\n Enter Side: ";
cin>>a;
Ar=pow(a,2);
cout<<"\n Area= "<<Ar; break;
default: cout<<"Wrong input!!!!";
}
getch();
}
===========================================================================
No comments:
Post a Comment