Modular Exponentiation

#include<bits/stdc++.h>
using namespace std;
int main()
{
int a,b,c;
cin>>a>>b>>c;
int res=1;

while(b>0)
{
    if(b & 1==1)
    {
        res=(res*a)%c;
    }
    a=(a*a)%c;
    b=b>>1;
    
}
cout<<res;

}
// 56789 3452 100000 57521

what to when c is 100000?

Hello @Shashank-Shekhar-2351214838461151,

I have corrected your code:

Hope, this would help.
Give a like if you are satisfied.