#include <assert.h>

/*
 * Factorial function in C for positive integers.
 *
 * Return (arg!).
 */
int
fact(int arg)
{
	int	result;

	assert(arg >= 0);	/* abort if argument is less than zero */
	for (result = 1; result > 0 && arg > 1; arg--) {
		result *= arg;
	}
	assert(result > 0);	/* abort if overflow */
	return result;
}
