text: Maximize volume of cuboid with given sum of sides | C # code to Maximize volume of cuboid with given sum of sides ; Return the maximum volume . ; finding length ; finding breadth ; finding height ; Driven Program
code: using System ; class GFG { static int maxvolume ( int s ) { int length = s / 3 ; s -= length ; int breadth = s / 2 ; int height = s - breadth ; return length * breadth * height ; } public static void Main ( ) { int s = 8 ; Console . WriteLine ( maxvolume ( s ) ) ; } }