calculate the length of a solid bar of 4cm diameter casted by melting solid cube its each sides is 22cm

Volume of a cube, Vc = (side length)³

Volume of a cylinder Vcy= πr²*h
where h=length/height of cylinder
r = radius of base
= diameter of base /2

If their volumes are equal, then
Vcy = Vc

πr²*h = side³

Solve for h.