title: Calculating power using a for loop instead of applying the Math.pow method
body: <p>Trying a method to find the power of a number using a for loop and without using Math.pow. For this result I just got 2.0 as it doesn't seem to go back round through the loop. Help please.</p>
  
  <pre><code>public void test() {
           {
                  double t = 1; 
                  double b = 2; // base number
                  double exponent = 2;
  
                  for (int i = 1; i&lt;=exponent; i++); 
                      t = t*b;
  
                      System.out.println(t); 
  </code></pre>