title: Calculating (a^b)%MOD
body: <p>I want to code for calculating the value of pow(a,b)%MOD. I use C++ to code.</p>
  
  <p>But the problem is the value of b can be very large. I know the log(b) time complexity method. But, the value of b might not fit in the data type "long long" of C++. For example b can be 1000000000 th Fibonacci number. Exact calculation of such a big number is itself, not possible (in time limits).</p>
  
  <p>P.S. :</p>
  
  <ul>
  <li>pow(a,b) means a*a*a*a*... b times.</li>
  <li>X % MOD means the remainder obtained on dividing X by MOD.</li>
  </ul>