All pastes #445565 Raw Edit

Anonymous

public text v1 · immutable
·published 2007-04-17 22:56 UTC
rendered paste body
#include <stdio.h>

int f(int x, int y);

int main(void)
{
	printf("Enter number for x and y:\n ");
	scanf("%d %d", &xTemp &yTemp);
	
	int result, xTemp, yTemp;

	result = f( xTemp, yTemp );

	printf( result );

	return 0;
}


int f(int x, int y)
{
    
	if(x<0 || y<0)
	{
		return x-y;
	}
	else
	{
        return f(x-1, y) + f(x, y-1);
	}

}