TP-02/facto/facto.c

13 lines
193 B
C

#include <stdio.h>
#include "facto.h"
unsigned long facto(unsigned long n)
{
unsigned long t = 1;
for(unsigned long i = 2; i <= n; i++)
{
t = i * t;
}
return t;
}