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 = 10Output:33.1%Input:x = 50Output:237.5%

**Approach**

- In a cube, all sides are equal, so,

**length = breadth = height** - let side of the cube =
**a** - given percentage increase =
**x%** - so, volume before increase =
**a^3** - after increase, new side =
**a + ax/100** - so, new volume =
**(a + ax/100)^3**=**a^3 + (ax/100)^3 + 3a^3x/100 + 3a^3x^2/10000** - increase in volume = new volume – old volume =
**(a^3 + (ax/100)^3 + 3a^3x/100 + 3a^3x^2/10000) – a^3**=**(ax/100)^3 + 3a^3x/100 + 3a^3x^2/10000** - so, percentage increase in volume =
**(((ax/100)^3 + 3a^3x/100 + 3a^3x^2/10000)/a^3) * 100**=**((x/100)^3 + 3x/100 + 3x^2/10000) * 100 = x^3/10000 + 3x + 3x^2/100**

Below is the implementation of the above approach:

## C++

`// C++ program to find percentage increase ` `// in the volume of the cube ` `// if a side of cube is increased ` `// by a given percentage ` ` ` `#include <bits/stdc++.h> ` `using` `namespace` `std; ` ` ` `void` `newvol(` `double` `x) ` `{ ` ` ` `cout << ` `"percentage increase "` ` ` `<< ` `"in the volume of the cube is "` ` ` `<< ` `pow` `(x, 3) / 10000 + 3 * x ` ` ` `+ (3 * ` `pow` `(x, 2)) / 100 ` ` ` `<< ` `"%"` `<< endl; ` `} ` ` ` `// Driver code ` `int` `main() ` `{ ` ` ` `double` `x = 10; ` ` ` `newvol(x); ` ` ` `return` `0; ` `} ` |

*chevron_right*

*filter_none*

## Java

`// Java program to find percentage increase ` `// in the volume of the cube ` `// if a side of cube is increased ` `// by a given percentage ` `import` `java.io.*; ` ` ` `class` `GFG ` `{ ` ` ` `static` `void` `newvol(` `double` `x) ` `{ ` ` ` `System.out.print( ` `"percentage increase "` ` ` `+` `"in the volume of the cube is "` ` ` `+ (Math.pow(x, ` `3` `) / ` `10000` `+ ` `3` `* x ` ` ` `+ (` `3` `* Math.pow(x, ` `2` `)) / ` `100` `) ); ` ` ` `System.out.print(` `"%"` `); ` `} ` ` ` `// Driver code ` `public` `static` `void` `main (String[] args) ` `{ ` ` ` `double` `x = ` `10` `; ` ` ` `newvol(x); ` `} ` `} ` ` ` `// This code is contributed by anuj_67.. ` |

*chevron_right*

*filter_none*

## Python3

`# Python program to find percentage increase ` `# in the volume of the cube ` `# if a side of cube is increased ` `# by a given percentage ` ` ` `def` `newvol(x): ` ` ` ` ` `print` `(` `"percentage increase"` ` ` `"in the volume of the cube is "` `, ` ` ` `((x` `*` `*` `(` `3` `)) ` `/` `10000` `+` `3` `*` `x ` ` ` `+` `(` `3` `*` `(x` `*` `*` `(` `2` `))) ` `/` `100` `),` `"%"` `); ` ` ` `x ` `=` `10` `; ` `newvol(x); ` ` ` `# This code is contributed by PrinciRaj1992 ` |

*chevron_right*

*filter_none*

## C#

`// C# program to find percentage increase ` `// in the volume of the cube ` `// if a side of cube is increased ` `// by a given percentage ` `using` `System; ` ` ` `class` `GFG ` `{ ` ` ` `static` `void` `newvol(` `double` `x) ` `{ ` ` ` `Console.Write( ` `"percentage increase "` ` ` `+` `"in the volume of the cube is "` ` ` `+ (Math.Pow(x, 3) / 10000 + 3 * x ` ` ` `+ (3 * Math.Pow(x, 2)) / 100) ); ` ` ` `Console.Write(` `"%"` `); ` `} ` ` ` `// Driver code ` `public` `static` `void` `Main () ` `{ ` ` ` `double` `x = 10; ` ` ` `newvol(x); ` `} ` `} ` ` ` `// This code is contributed by anuj_67.. ` |

*chevron_right*

*filter_none*

**Output:**

percentage increase in the volume of the cube is 33.1%

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.

## 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 the volume of cuboid if length, breadth and height are increased by fixed percentages
- Python | Percentage increase in hemisphere volume if radius is increased
- Python | Percentage increase in the total surface area of the cuboid
- Percentage change in Hemisphere volume if radius is changed
- Volume of cube using its space diagonal
- Program for Volume and Surface Area of Cube
- Area of Triangle using Side-Angle-Side (length of two sides and the included angle)
- Find Selling Price from given Profit Percentage and Cost
- Find cost price from given selling price and profit or loss percentage
- Maximize volume of cuboid with given sum of sides
- Find the concentration of a solution using given Mass and Volume
- Find maximum volume of a cuboid from the given perimeter and area
- Program to find the percentage of difference between two numbers
- Program to find the Discount Percentage
- Overall percentage change from successive changes
- Loss when two items are sold at same price and same percentage profit/loss
- Program to find the rate percentage from compound interest of consecutive years
- Find the percentage change in the area of a Rectangle

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.