Its just the volume of all the cylinders you have.
Volume of a cylinder is area*height
The height of the cylinder is the stroke, and the area is the area of the top of the piston which is Pi*(1/2*bore)^2 (Pi is approx=3.14)
then multiply by the number of cylinders you have, which in any car that you'd care about figuring out the displacement is 8 or higher.
so on a 302 (4" bore, 3" stroke) its--> 3.14*(1/2*4)^2 * 3 * 8 = 301.44, round up to 302
using a more accurate value of Pi will yield a more accurate answer, for instance using Pi=3.141592654 will give you 301.5928949 sq in
hope this helps