answersLogoWhite

0


Best Answer

# include

# include

int ch,r,a,h,d,l;

float Ac, Ar, At;

void main()

{

clrscr();

printf("\n press1,area of circle");

printf("\n press2,area of rectangle");

printf("\n press3,area of triangle");

printf("\n enter your choice");

scanf("%d",&ch);

switch(ch)

{

case 1: printf("\n enter values to find area of circle");

scanf ("%d",&r);

Ac = 3.14*r*r;

printf("\n area of circle is %f",Ac);

break;

case 2: printf("\n enter values to find area of rectangle ");

scanf("%d%d",&a,&h);

Ar= a*h;

printf("\n area of rectangle is %f",Ar);

break;

case 3: printf("\n enter values to find volume of cylinder");

scanf("%d%d",&d,&l);

At = 0.5*d*l;

printf("\n area of triangle is %f",At);

break;

DEFAULT: printf("\n enter the proper choice");

}

getch();

}

User Avatar

Wiki User

13y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: Write a program using switch case to find the area of a square rectangle and a cylinder using functions?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

Why is a shadow of a cylinder a square or a rectangle?

Because of the dimensions of the cylinder, once shadowed, the shadow resembles a rectangle due to the flat top of the cylinder and the smooth surfaces.


What is the difference between a cube and cylinder?

a cube is a 3d square and a cylinder is 3d circle + rectangle shape.


What isn't a cone sphere cylinder prism or pyramid?

a square a rectangle and a parallelogram


What shape would be the side view of a cylinder?

A rectangle. If the cylinder has the same height as its width, the side view would be a square.


What 2D shape wil be see in vertically cut cylinder?

A quadrilateral rectangle or a square


Is a rectangle a square when a square not a rectangle?

A square is a rectangle even through a rectangle is not always a square.


Is a rectangle the same as a square?

No. A square is a rectangle, but a rectangle is not a square.


Whats the difference between a cube and a cylinder?

There is not much difference between a cube and a cylinder. The cube is a 3d square and a cylinder is actually 3d circle in a rectangle form.


What is a square is a rectangle?

A square is always a rectangle, but it is a rectangle that isn't a square.


What is a rectangle a square?

A square is always a rectangle, but it is a rectangle that isn't a square.


What is an rectangle?

a rectangle cant be a square but a square can be a rectangle


What is special about a 3d cylinder?

One thing special is that there is not a 2-d cylinder analogue - like a square for a cube or a rectangle for a cuboid, triangle/tetrahedron.