aboutsummaryrefslogtreecommitdiff
path: root/semestre 3/structures des données/td/td1/exo1.c
blob: 669589b0635c415c5fe0754480369d9de163a0b7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#include <stdio.h>

/* factorielle récursive */
int xy(int n){
    if (n) {
        /* warum nicht ? */
        return n*(xy(n-1));
    } else {
        return 1;
    }
}

void main(void){
    printf("%d", xy(5));
}