the algorithm is
x= 1, n=0
1/x^n, n<0
x*x^(n1), n>0
 int power(int n)

{

if (n==0)

return 1;

else if (n<0)

return (1/(x*power(n)));

else

return (x*(x*power(n1)));

}
The problem appears to be in your second branch. If n < 0, you will indeed call the recursive function again, but you are passing it the same value of n. This value is negative still, and so you will always execute the second branch. Thus, n never changes, and your end condition is never reached. While you coded your given algorithm correctly, the algorithm itself is wrong. Try this algorithm:
x^n = 1 / (x ^ n), where n < 0 and n is the absolute value of n.
Also, your third branch (for n > 0) multiplies the value by an extra x. It should just be x * power(n1).
Next I'd suggest passing power the x value as well, rather than having both values declared as global. This will make the function portable, so you will not have to rewrite a recursive power function ever time you need one.
Finally, 1 / anything will be a double value, but your function returns an integer. This means that any negative exponent created will be returned as x. You should make this function return a double.