Example
void write_sqrt( double x)
// Precondition: x >= 0.
// Postcondition: The square root of x has
// been written to the standard output.
...
}
The precondition and postcondition appear as comments in your program.
They are usually placed after the function’s parameter list.
Previous slide
Next slide
Back to first slide
View graphic version