そこまで出てるんだったら、きちんと授業を聞いとればできるんだがな。

ヒント:
n!を出す関数

int foo(n)
{
int a;
for(a = 1; 0 < n; n--) {
a *= n
}
return a;
}