# 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:** 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:

## C++

`// C++ implementation of the approach ` `#include <bits/stdc++.h> ` `using` `namespace` `std; ` ` ` `// Function to return the percentage increase ` `// in the volume of the cuboid ` `double` `increaseInVol(` `double` `l, ` `double` `b, ` `double` `h) ` `{ ` ` ` `double` `percentInc = (1 + (l / 100)) ` ` ` `* (1 + (b / 100)) ` ` ` `* (1 + (h / 100)); ` ` ` `percentInc -= 1; ` ` ` `percentInc *= 100; ` ` ` ` ` `return` `percentInc; ` `} ` ` ` `// Driver code ` `int` `main() ` `{ ` ` ` `double` `l = 50, b = 20, h = 10; ` ` ` `cout << increaseInVol(l, b, h) << ` `"%"` `; ` ` ` ` ` `return` `0; ` `} ` |

*chevron_right*

*filter_none*

## Java

`// Java implementation of the approach ` `class` `GFG ` `{ ` ` ` `// Function to return the percentage increase ` `// in the volume of the cuboid ` `static` `double` `increaseInVol(` `double` `l, ` ` ` `double` `b, ` ` ` `double` `h) ` `{ ` ` ` `double` `percentInc = (` `1` `+ (l / ` `100` `)) * ` ` ` `(` `1` `+ (b / ` `100` `)) * ` ` ` `(` `1` `+ (h / ` `100` `)); ` ` ` `percentInc -= ` `1` `; ` ` ` `percentInc *= ` `100` `; ` ` ` ` ` `return` `percentInc; ` `} ` ` ` `// Driver code ` `public` `static` `void` `main(String[] args) ` `{ ` ` ` `double` `l = ` `50` `, b = ` `20` `, h = ` `10` `; ` ` ` `System.out.println(increaseInVol(l, b, h) + ` `"%"` `); ` `} ` `} ` ` ` `// This code is contributed by Code_Mech ` |

*chevron_right*

*filter_none*

## Python3

`# Python3 implementation of the approach ` ` ` `# Function to return the percentage increase ` `# in the volume of the cuboid ` `def` `increaseInVol(l, b, h): ` ` ` `percentInc ` `=` `((` `1` `+` `(l ` `/` `100` `)) ` `*` ` ` `(` `1` `+` `(b ` `/` `100` `)) ` `*` ` ` `(` `1` `+` `(h ` `/` `100` `))) ` ` ` `percentInc ` `-` `=` `1` ` ` `percentInc ` `*` `=` `100` ` ` ` ` `return` `percentInc ` ` ` `# Driver code ` `l ` `=` `50` `b ` `=` `20` `h ` `=` `10` `print` `(increaseInVol(l, b, h), ` `"%"` `) ` ` ` `# This code is contributed by Mohit Kumar ` |

*chevron_right*

*filter_none*

## C#

`// C# implementation of the approach ` `using` `System; ` ` ` `class` `GFG ` `{ ` ` ` `// Function to return the percentage increase ` `// in the volume of the cuboid ` `static` `double` `increaseInVol(` `double` `l, ` ` ` `double` `b, ` ` ` `double` `h) ` `{ ` ` ` `double` `percentInc = (1 + (l / 100)) * ` ` ` `(1 + (b / 100)) * ` ` ` `(1 + (h / 100)); ` ` ` `percentInc -= 1; ` ` ` `percentInc *= 100; ` ` ` ` ` `return` `percentInc; ` `} ` ` ` `// Driver code ` `public` `static` `void` `Main() ` `{ ` ` ` `double` `l = 50, b = 20, h = 10; ` ` ` `Console.WriteLine(increaseInVol(l, b, h) + ` `"%"` `); ` `} ` `} ` ` ` `// This code is contributed by Code_Mech ` |

*chevron_right*

*filter_none*

**Output:**

98%

## Recommended Posts:

- 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
- Percentage increase in volume of the cube if a side of cube is increased by a given percentage
- Python | Percentage increase in the total surface area of the cuboid
- Maximize volume of cuboid with given sum of sides
- Find maximum volume of a cuboid from the given perimeter and area
- Length of longest rod that can fit into a cuboid
- Overall percentage change from successive changes
- Program to find the Discount Percentage
- Program to find the percentage of difference between two numbers
- Find Selling Price from given Profit Percentage and Cost
- Source to destination in 2-D path with fixed sized jumps
- Program to find the rate percentage from compound interest of consecutive years
- Program to find Length of Bridge using Speed and Length of Train
- Find cost price from given selling price and profit or loss percentage

If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. 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.