# C Program For Find Radius, Circumference and Volume of Cylinder Using Switch Case

Problem:- C Program For Find Radius, Circumference or Circle and Volume of Cylinder Using Switch Case or c program to find volume of cylinder or c program to find circumference of circle or c program to find area of circle or C Program For Find Radius, Circumference and Volume of Cylinder Using Switch Case or C Program For Find Radius, Circumference, and Volume of Cylinder Using Do while loop or C Program For Find Radius, Circumference, and Volume of Cylinder Using loop or C Program For Find Radius, Circumference or Circle and Volume of Cylinder Using do while loop.

Logic:- As we can see that we have to only apply the formula of area of circle or circumference of circle and volume of the cylinder and print the output on the screen, but we also have to put the condition in switch case so that users can easily choose their choice and perform an appropriate operation. In this problem PI value is fixed Pi value up to 10 decimal numbers PI = 3.1415926535. Check The PI Value Up to 1,00,000 Numbers. See the below formulas and explanation of the problem so you can easily understand the problem.

Formula's Are using in problem

2. Circumference of Circle = 2 * PI * Radius

3. Volume of Cylinder = PI * Hight * Radius * Radius

Explanation:- In case 1 put the area of circle condition or in case 2 put the second condition Circumference of Circle and last but not least third condition put in case 3 Volume of Circle and now come to special condition case 4 if user want to quite then press 4 this will help to move out the user to loop. In case of the section, there is a special or default case help to check whether the user input the right input or not, if the user enters the input 5 then default case execute and print wrong input try again message on the console screen.

Example:-

Case 1

Output =

Case 2

Output =

Case 3

Enter Hight = 5
Output =

Case 0

Output = Exit Program

Case Default:- When user Input another number except 0, 1, 2, 3 or we can say greater than 3.

Output = Wrong Input...Try Again!!!

Solution:-

#include<stdio.h>
#include<conio.h>

int main()
{

/*visit www.programmingwithbasics.com*/
char quit;
int choice;
const float pi=3.1415658;

do
{
printf("\n=======================================");
printf("\nWhat Do You Want To Calculate?");
printf("\n1. For Area of Circle");
printf("\n2. For Circumference of Circle");
printf("\n3. For Volume of Cylinder");
printf("\n0. For For Quit");
printf("\n=======================================\n");
scanf("%d",&choice);

switch (choice)
{
case 1:
printf("\n=======================================");
printf("\n=======================================");
break;
case 2:
printf("=======================================");
printf("\n=======================================");
break;
case 3:
printf("\nEnter Hight of Cylinder:");
scanf("%f",&height);
printf("\n=======================================");
printf("\n=======================================");
break;
case 0:
quit='y';
break;
default:
printf("\n=======================================");
printf("\nWrong Choice....Try Again!!!\n");
printf("=======================================");
break;
}
}while(quit != 'y');

return 0;
}

Output:-