I have n!/((n-r)!r!)

which I figured out how to make recursive:

int crn (int n, int r)
{
	if (r==0||r==n)
		return 1;
	return (n-1)+(n-1,r-1);
}

how do I make it non-recursive?

I have n!/((n-r)!r!)

which I figured out how to make recursive:

int crn (int n, int r)
{
	if (r==0||r==n)
		return 1;
	return (n-1)+(n-1,r-1);
}

how do I make it non-recursive?

what is this?? This is not a program, nor is it a recursive function and it does not calculate factorial. Did you even read this before posting it?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.