title: C - Writing a function for an exponent without using Pow
body: <p>I have this program:</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  
  long int x_to_the_n (int x,int n)
  {
      int i; 
      int number;
  
  
   int i; 
  int i = 1;
  
  for (i = 0; i &lt; n; ++i)
      x = x*x;
  
  return(number);
  }
  
  int main()
  {
      int number;
      int exponent;
      int answer;
  
      printf  ("Enter a number: ");
      scanf ("%i", &amp;number);
  
      printf  ("Enter a number that represents the power you want your number to be raised     to: ");
      scanf ("%i", &amp;exponent);
  
      answer = x_to_the_n(number,exponent); 
  
      printf("X To The N is %li",answer);
  
      return 0;
  }
  </code></pre>
  
  <p>Right now, the function x_to_the_n is not correctly equating x ^ n...I was wondering if anyone had suggestions to calculate x to the n without using the c pow library function.</p>