title: Calculating powers of big numbers
body: <p>I am writing a program in C++ where I have to calculate the value of n^n where 1&lt;=n&lt;=10^9. But even if I use <code>long long</code> type to store the result, the answer is calculated just till n=15.
  At n=16, a floating point exception arises and and after that results show negative values. Can anybody tell me what is wrong with the code?</p>
  
  <pre><code>long long c;
  
  c=(long long)n;
  for(int i=2;i&lt;=n;i++)
     c*=n;
  
   cout&lt;&lt;c&lt;&lt;endl;
  </code></pre>