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. See the below formulas and explanation of the problem so you can easily understand the problem.
Formula's Are using in problem
1. Area of Circle = PI * Radius * Radius
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.
Output:
=======================================
What Do You Want To Calculate?
1. For Area of Circle
2. For Circumference of Circle
3. For Volume of Cylinder
0. For For Quit
=======================================
Enter Your Choice Here:2
Enter Radius of Circle:10
=======================================
Circumference of Circle = 62.83131
=======================================
=======================================
What Do You Want To Calculate?
1. For Area of Circle
2. For Circumference of Circle
3. For Volume of Cylinder
0. For For Quit
=======================================
Enter Your Choice Here:3
Enter Radius of Cylinder:10
Enter Hight of Cylinder:5
=======================================
Volume of cylinder = 1570.78296
=======================================
=======================================
What Do You Want To Calculate?
1. For Area of Circle
2. For Circumference of Circle
3. For Volume of Cylinder
0. For For Quit
Enter Your Choice Here:
need an explanation for this answer? contact us directly to get an explanation for this answer