Find file
Fetching contributors…
Cannot retrieve contributors at this time
executable file 14 lines (12 sloc) 197 Bytes
int fact( int x )
/* recursive factorial function */
{ if (x > 1)
return x * fact(x-1);
else
return 1;
}
void main( void )
{ int x;
x = read();
if (x > 0) write( fact(x) );
}