home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Info-Mac 3
/
Info_Mac_1994-01.iso
/
Development
/
Source
/
Little C Source
/
Ex4.c
< prev
next >
Encoding:
Amiga
Atari
Commodore
DOS
FM Towns/JPY
Macintosh
Macintosh JP
Macintosh to JP
NeXTSTEP
RISC OS/Acorn
Shift JIS
UTF-8
Wrap
C/C++ Source or Header
|
1993-10-04
|
206 b
|
17 lines
|
[
TEXT/EDIT
]
/* This program demonstrates recursive functions. */
main()
{
print(factr(7) * 2);
}
/* return the factorial of i */
factr(int i)
{
if(i<2) {
return 1;
}
else {
return i * factr(i-1);
}
}