I think this should work.
double Factorial(double cur_num)
static double rvalue=0.0;
if (cur_num)<=0 return (rvalue);
} else rvalue*=cur_num;
I couldn't think of any way to explain this w/o giving it away.
Here is another example of recursion.
This only works if left and top both start at 0. I didn't want to add code to confuse the matter in order to fix this. Also right and bottom are assumed to be larger values than left and top.
void QuadExample(int depth,int left,int top,int right,int bottom)
if (depth<=0 || ((right-left)<=2)) return;
//Draw randomly colored square
RGB color(rand()% 255,rand ()%255, rand%255);