Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #define PI 3.141592653589793
- int main() {
- double volume, radius;
- printf("Input volume: ");
- scanf("%lf", &volume); //get the volume of the cylinder
- printf("Input radius: ");
- scanf("%lf", &radius); //get the radius of the cylinder
- double height = volume/(radius*radius*PI); //calculate the height of the cylinder
- printf("Height of Cylinder: %lf\n", height); //output it to height console
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement