a^n program

Where am i going wrong? somebody please help.
https://www.codechef.com/viewsolution/19075205

n is as large as 10^9 but pow() function might give some error as Power is too large u need to check for Another simple approach.

n is as large as 10^9 but pow() function might give some error as Power is too large u need to check for Another simple approach.

Yes! Thank you so much. pow() is giving wrong output with a power of 10^9.