home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Chip 2001 January
/
Chip_2001-01_cd1.bin
/
tema
/
mysql
/
mysql-3.23.28g-win-source.exe
/
dbug
/
factorial.c
< prev
next >
Wrap
C/C++ Source or Header
|
2000-08-31
|
358b
|
18 lines
#ifdef DBUG_OFF /* We are testing dbug */
#undef DBUG_OFF
#endif
#include <global.h>
int factorial (value)
register int value;
{
DBUG_ENTER ("factorial");
DBUG_PRINT ("find", ("find %d factorial", value));
if (value > 1) {
value *= factorial (value - 1);
}
DBUG_PRINT ("result", ("result is %d", value));
DBUG_RETURN (value);
}