Open In App

Percentage increase in the cylinder if the height is increased by given percentage but radius remains constant

Last Updated : 31 May, 2022
Improve
Improve
Like Article
Like
Save
Share
Report

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



 

C++

// 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;
}

                    

Java

// 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..

                    

Python3

# 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

                    

C#

// 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..

                    

Javascript

<script>
// javascript program to find percentage increase
// in the cylinder if the height
// is increased by given percentage
// but radius remains constant
function newvol(x)
{
    document.write( "percentage increase "
        + "in the volume of the cylinder is "
        + x + "%" );
}
 
// Driver code
var x = 10;
newvol(x);
 
// This code is contributed by 29AjayKumar
</script>

                    

Output: 
 

percentage increase in the volume of the cylinder is 10.0%

Time Complexity: O(1), since there is no loop.

Auxiliary Space: O(1), since no extra space has been taken.



Similar Reads

Percentage increase in volume of the sphere if radius is increased by a given percentage
Given here is a sphere, whose radius is increased by a given percentage. The task is to find the percentage increase in the volume of the sphere.Examples: Input: x = 10 Output: 33.1% Input: x = 50 Output: 237.5% Approach: Let, the radius of the sphere = agiven percentage increase = x%volume before increase = 4/3*πa^3new radius after increase = a +
3 min read
Python | Percentage increase in hemisphere volume if radius is increased
Given that the radius of a hemisphere is increased by a fixed percentage so, the target is to calculate the percentage increase in the volume of the hemisphere. Examples: Input : 20 Output : 72.8 %Input : 70 Output : 391.3 % Approach: Let, the radius of the hemisphere = [Tex]a [/Tex]Given percentage increase = [Tex]x% [/Tex]Volume before increase =
2 min read
Percentage increase in volume of the cube if a side of cube is increased by a given percentage
Given here is a cube, whose one side is increased by a given percentage. The task is to find percentage increase in the volume of the cube.Examples: Input: x = 10 Output: 33.1% Input: x = 50 Output: 237.5% Approach In a cube, all sides are equal, so, length = breadth = heightlet side of the cube = agiven percentage increase = x%so, volume before in
3 min read
Percentage increase in the volume of cuboid if length, breadth and height are increased by fixed percentages
Given a cuboid and three integers L, B, and H. If the length of the cuboid is increased by L%, breadth is increased by B% percent, and height is increased by H% percent. The task is to find the percentage increase in the volume of the cuboid.Examples: Input: L = 50, B = 20, H = 10 Output: 98%Input: L = 10, B = 20, H = 30 Output: 71.6% Approach: Sup
4 min read
Maximize the first element of the array such that average remains constant
Given an array arr[] of length N and an integer X, the task is to find the maximum value R of updated first element such that the average of the array remains constant and no elements of the array should become negative. The maximum value of the first element should be in the range arr[0] &lt;= R &lt;= X Examples: Input: arr[] = {1, 2, 3, 4}, X = 5
6 min read
Radii of the three tangent circles of equal radius which are inscribed within a circle of given radius
Given here is a circle of a given radius. Inside it, three tangent circles of equal radius are inscribed. The task is to find the radii of these tangent circles. Examples: Input: R = 4Output: 1.858 Input: R = 11Output: 5.1095 Approach: Let the radii of the tangent circles be r, and the radius of the circumscribing circle is R.x is the smaller dista
3 min read
Find maximum height to cut all chocolates horizontally such that at least K amount remains
Given an array arr[] consisting of heights of N chocolate bars, the task is to find the maximum height at which the horizontal cut is made to all the chocolates such that the sum remaining amount of chocolate is at least K. Examples: Input: K = 7, arr[] = [15, 20, 8, 17]Output: 15Explanation:Suppose a cut is made at height 8:-&gt; chocolate taken f
10 min read
Python | Percentage increase in the total surface area of the cuboid
Given a cuboid of length L, breadth B and Height H, the task is to find percentage increase in the total surface area of the cuboid if length, breadth and height are increased by fixed percentages. Examples: Input : L = 20, B = 30, H = 50, l = 10 %, b = 12 %, h = 15 % Output : 26.97 % Input : L = 40, B = 60, H = 15, l = 5 %, b = 7 %, h = 12 % Outpu
2 min read
Radius of the circle when the width and height of an arc is given
Given a circle in which the width and height of an arc are given. The task is to find the radius of the circle with the help of the width and height of the arc.Examples: Input: d = 4, h = 1 Output: The radius of the circle is 2.5 Input: d = 14, h = 8 Output: The radius of the circle is 7.0625 Approach Let the radius of the circle be rLet the height
4 min read
Percentage change in Hemisphere volume if radius is changed
Given that the radius of a hemisphere is changed by a fixed percentage so, the target is to calculate the percentage changed in the volume of the hemisphere. Examples: Input: r = 20% Output: 72.80%Input: r = 70% Output: 391.30 % Approach: Let, the radius of the hemisphere = [Tex]a [/Tex] Given percentage increase = [Tex]x% [/Tex] Volume before incr
5 min read
Article Tags :
Practice Tags :