summaryrefslogtreecommitdiff
path: root/sem_5/HLIN504_Systeme/TP1/fact.c
blob: 3c33b09fc8af6606b3b06d32d223fe2097a24e89 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
#include <stdio.h>
#include <stdlib.h>

int fact (int x);

int main (int argc, char ** argv){
  printf("%d \n", fact(atoi(argv[1])));
  return 0;
}

int fact (int x){
  return x == 0 ? 1: x * fact( x-1);
}