Commit 558c2a2d authored by Michael Beck's avatar Michael Beck
Browse files

the famous Factorial example

[r20776]
parent 5ea724df
#include <stdio.h>
#include <stdlib.h>
int factorial(int x) {
if (x == 0)
return 1;
return x * factorial(x-1);
}
int main(int argc, char **argv) {
int val = atoi(argv[0]);
printf("%d\n", factorial(val));
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment