Modular exponentiation

https://ide.codingblocks.com/s/188376 which case is not working

Hi @sgdon142
You need to just print result of pow(a,b,c)%c in the main function. Because you code is failing for that case when b==1 and c>a and then you are getting wrong answer. For example if input is 8 1 3 then you get output as 8 but correct output is 2.

Here is your corrected code :

If your doubt is clear then mark it as resolved.