Skip to content
Related Articles

Related Articles

Percentage increase in the cylinder if the height is increased by given percentage but radius remains constant
  • Last Updated : 05 Jul, 2019


Given here is a right circular cylinder, whose height increases by a given percentage, but radius remains constant. The task is to find the percentage increase in the volume of the cylinder.

Examples:

Input: x = 10
Output: 10%

Input: x = 18.5
Output: 18.5%

Approach:

  • Let, the radius of the cylinder = r
  • height of the cylinder = h
  • given percentage increase = x%
  • so, old volume = π*r^2*h
  • new height = h + hx/100
  • new volume = π*r^2*(h + hx/100)
  • so, increase in volume = πr^2*(hx/100)
  • so percentage increase in volume = (πr^2*(hx/100))/(πr^2*(hx/100))*100 = x

 <strong>percentage increase in the volume = percentage increase in height</strong>

C++

filter_none

edit
close

play_arrow

link
brightness_4
code

// C++ program to find percentage increase
// in the cylinder if the height
// is increased by given percentage
// but radius remains constant
  
#include <bits/stdc++.h>
using namespace std;
  
void newvol(double x)
{
    cout << "percentage increase "
         << "in the volume of the cylinder is "
         << x << "%" << endl;
}
  
// Driver code
int main()
{
    double x = 10;
    newvol(x);
    return 0;
}

chevron_right


Java

filter_none

edit
close

play_arrow

link
brightness_4
code

// Java program to find percentage increase
// in the cylinder if the height
// is increased by given percentage
// but radius remains constant
import java.io.*;
  
class GFG 
{
  
static void newvol(double x)
{
    System.out.print( "percentage increase "
        + "in the volume of the cylinder is "
        + x + "%" );
}
  
// Driver code
public static void main (String[] args) 
{
    double x = 10;
    newvol(x);
}
}
  
// This code is contributed by anuj_67..

chevron_right


Python3

filter_none

edit
close

play_arrow

link
brightness_4
code

# Python3 program to find percentage increase
# in the cylinder if the height
# is increased by given percentage
# but radius remains constant
  
def newvol(x):
    print("percentage increase in the volume of the cylinder is ",x,"%")
  
# Driver code
x = 10.0
newvol(x)
  
# This code is contributed by mohit kumar 29

chevron_right


C#

filter_none

edit
close

play_arrow

link
brightness_4
code

// C# program to find percentage increase
// in the cylinder if the height
// is increased by given percentage
// but radius remains constant
using System;
  
class GFG 
{
  
static void newvol(double x)
{
    Console.WriteLine( "percentage increase "
        + "in the volume of the cylinder is "
        + x + "%" );
}
  
// Driver code
public static void Main () 
{
    double x = 10;
    newvol(x);
}
}
  
// This code is contributed by anuj_67..

chevron_right


Output:

percentage increase in the volume of the cylinder is 10.0%

Attention reader! Don’t stop learning now. Get hold of all the important DSA concepts with the DSA Self Paced Course at a student-friendly price and become industry ready.




My Personal Notes arrow_drop_up
Recommended Articles
Page :