APL/Révisions/CM/debordement.c
2022-01-25 12:00:33 +01:00

20 lines
447 B
C

#include <stdio.h>
#include <stdlib.h>
unsigned long int factorielle(unsigned long int n) {
if (n > 1) {
return n * factorielle(n-1);
} else return 1UL;
}
int main(int argc, char *argv[]) {
unsigned long int l;
int n = 1;
printf("%d\n", sizeof(l));
while (factorielle(n+1) >= factorielle(n)) n++;
l = factorielle(n);
printf("valeur de n = %d, valeur de %d! = %lu\n", n, n, l);
return EXIT_SUCCESS;
}