rve/example/example.c

17 lines
190 B
C

#include "printf.h"
int fact(int n) {
if (n == 0)
return 1;
return n * fact(n-1);
}
int main() {
int n = 8;
int res = fact(8);
printf("%d! = %d\n", n, res);
return 0;
}