title: Find a number to the power of another number?
body: <p>I am trying to write a function in java that finds the result of an operand raised to the power of another.  </p>
  
  <p>I <strong>can't use the pow function</strong> or any form of loop. What are any possible solutions? I tried "^" and that didn't work.</p>
  
  <pre><code>public static String raiseP(int op1, int op2){
      int result  = op1 ^ op2;  //Doesn't Work
      return result; 
  }
  </code></pre>
  
  <p>Would there be a way to do this using basic math?</p>
  
  <p>I have written:</p>
  
  <pre><code>public static int pow(int x, int y, int n, int z){
    if (y == n){
        System.out.println(z);
        return z;
    }
    else{
        z = z*x;
        n += 1;
        pow(x,y,n,z);
        return 0;      
    }
  
  }
  ex: pow(5,9,0,1) == 5^9
  </code></pre>
  
  <p>but am not allowed to use recursion.</p>