previous | index | next

Function Calls

Recall that the volume of a cylinder is computed using V = πr2h.

Compare:

Racket C++
(define cylinder-volume
  (lambda (radius height)
    (* 3.1415927 (square radius) height)))
double cylinderVolume(double radius, double height) {
  return 3.14159 * square(radius) * height;
}


previous | index | next