Some test cases are failing

some of my test cases are failing kindly look into my code
https://ide.codingblocks.com/s/411773 this is the link to my code

Hey @av8055

why have you placed %c in the 31 line please explain https://ide.codingblocks.com/s/411785

(a*b)%c can be written as ((a%c) *(b%c))%c

Now using this we can write line 31
otherwise ans will overflow

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.