Modular exponentiation

(some test cases are not passing)

#include
using namespace std;
#include<math.h>
int main() {
long long int a,b,c,l,n;
cin>>a>>b>>c;
l=pow(a,b);
n=l%c;
cout<<n;
return 0;
}

@mishranavneet1710
some test case are not passing because pow(a,b) may exceed long long range.to rectify it use modular exponentiation

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.