previous | index | next

A Complete Program

/* 
 * File:   cylinder-program.cpp
 * Author: T. Colburn
 *
 * Created on October 10, 2008, 6:32 PM
 */

#include <iostream>
using namespace std;


// ****************************************************

double square(double x) {
  return x * x;
}

double cylinderVolume(double radius, double height) {
  return 3.14159 * square(radius) * height;
}

int main(int argc, char** argv) {
  cout << cylinderVolume(5, 4);
}
  • All text between "/*" and "*/" is interpreted as a comment.

previous | index | next