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.
Input: L = 50, B = 20, H = 10
Input: L = 10, B = 20, H = 30
Approach: Suppose the original length, breadth and height of the cuboid be l, b and h respectively. Now, the increased length will be (l + ((L * l) / 100)) i.e. increasedLength = l * (1 + (L / 100)). Similarly, increased breadth and height will be increasedBeadth = b * (1 + (B / 100)) and increasedHeight = h * (1 + (H / 100)).
Now, calculate originalVol = l * b * h and increasedVol = increasedLength * increasedBreadth * increasedHeight.
And, the percentage increase can be found as ((increasedVol – originalVol) / originalVol) * 100
(((l * (1 + (L / 100)) * b * (1 + (B / 100)) h * (1 + (H / 100))) – (l * b * h)) / (l * b * h)) * 100
((l * b * h * (((1 + (L / 100)) * (1 + (B / 100)) * (H / 100)) – 1)) / (l * b * h)) * 100
(((1 + (L / 100)) * (1 + (B / 100)) * (1 + (H / 100))) – 1) * 100
Below is the implementation of the above approach:
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.
- Percentage increase in volume of the cube if a side of cube is increased by a given percentage
- Percentage increase in volume of the sphere if radius is increased by a given percentage
- Percentage increase in the cylinder if the height is increased by given percentage but radius remains constant
- Python | Percentage increase in hemisphere volume if radius is increased
- Python | Percentage increase in the total surface area of the cuboid
- Find maximum volume of a cuboid from the given perimeter and area
- Maximize volume of cuboid with given sum of sides
- Percentage change in Hemisphere volume if radius is changed
- Length of longest rod that can fit into a cuboid
- Breadth First Search without using Queue
- Find Selling Price from given Profit Percentage and Cost
- Find cost price from given selling price and profit or loss percentage
- Loss when two items are sold at same price and same percentage profit/loss
- Program to find the percentage of difference between two numbers
- Program to find the Discount Percentage
- Overall percentage change from successive changes
- Program to find the rate percentage from compound interest of consecutive years
- Find the percentage change in the area of a Rectangle
- Source to destination in 2-D path with fixed sized jumps
- Check if digit cube limit of an integer arrives at fixed point or a limit cycle
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to email@example.com. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.