Regarding some test cases

Can you please help me I am passing only some test cases. Why is it so?

hey @punetha.anmol001 share your code using ide.codingblocks.com

check now ->

Why adding modulus c solved the problem, can you explain?

just to avoid overflow of the data type, like if a is 10^7 and you will do it’s square then it will overflow long long int. so to avoid it, we are using modulo c

Oh got it, Thank you

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.