BINARY EXPONENTIATION

Question:https://www.spoj.com/problems/LASTDIG/

Solution: https://ide.geeksforgeeks.org/qjfFsBcOcH

Can you pls check out the above question, it is a very simple solution yet when submitting gives WA, please help me resolve it.