[ create a new paste ] login | about

Link: http://codepad.org/DEAru9fH    [ raw code | output | fork ]

lyther - C, pasted on Oct 26:
#include <stdio.h>
 
int factorial(int x);
int main(void){
    
printf("%i",factorial(10));
 
return 0;
}
 
 
int factorial (int x){
 
if(x <= 1){
x = 1;
}
else{
x =  x * factorial(x-1);
}
 
//printf("%i", x);
return x;
}


Output:
1
3628800


Create a new paste based on this one


Comments: