text cover

Data Abstraction and Problem Solving with C++

Walls and Mirrors

by Frank M. Carrano

Addison Wesley Logo

c01p052.cpp File Reference


Detailed Description

Functions should enforce their preconditions.

Date:
29 May 2006
Chapter:
Chapter 1
Page:
Page 52
Version:
5.0

Definition in file c01p052.cpp.

Go to the source code of this file.

Functions

int factorial (int n)


Function Documentation

int factorial int  n  ) 
 

Computes the factorial of an integer.

Precondition:
n >= 0.
Postcondition:
None.
Parameters:
n The given integer.
Returns:
n * (n - 1) * ... * 1, if n > 0; else 1, if n == 0.

Definition at line 22 of file c01p052.cpp.


Generated on Sat Aug 26 19:58:10 2006 for AWLogo by  doxygen 1.4.6