Modular exponentiation problem fail to pass the last test case

Problem:-https://online.codingblocks.com/player/15084/content/5076
my code:
#include<bits/stdc++.h>
using namespace std;

int powermod(int a,int b,int c)
{
int ans;
if(b==0)
return 1;

ans=(powermod(a,b/2,c)%c);
ans=((ans%c)*(ans%c))%c;

if(b&1)
  ans=((a%c)*(ans%c))%c;

return ans;
}
int main() {
int a,b,c;
cin>>a>>b>>c;
cout<<powermod(a,b,c)<<endl;
return 0;
}

Hi Nargis, pls share the problem name and also save the above code in ide.codingblocks.com and share the link here