Re: [Dev-C++] factorial code additional
Open Source C & C++ IDE for Windows
Brought to you by:
claplace
|
From: Jason H. <jas...@bt...> - 2001-10-21 23:20:52
|
Minor update to the factorial function.
// factorial function
inline int factorial(int n)
{
int r =3D 1;
for(; n > 1; r *=3D n--);
return r;
}
When testing a function I expand out things like post-increments to =
avoid confusion and problems. It doesn't matter much as they both still =
work. This is just a minor style improvement in my eyes. :)
Jason.
|