Can someone help me with this math?

a right circular cone of maximum volume is to be cut from a solid wooden right circular cylinder. what fraction of the volume of the cylinder will be discarded?

and if you could tell me how you did it. thank you :)

volume of a cone = 1/3*pi*r^2*h
volume of a cylinder = pi*r^2*h
volume of a cylinder - volume of a cone = pi*r^2*h-1/3pi*r^2*h
answer is 2/3pi*r^2*h