The volume of a prism (a cylinder is a prism) is it's cross-sectional area multiplied by it's length.

For a cylinder the cross sectional area is a circle: where d is the diameter and h the height/length of the pipe.

Make sure your units are consistent