Modular exponentiation- some failed test cases

code: #include bits/stdc++.h
using namespace std;
int main() {
long long int a,b,c;
cin>>a>>b>>c;

long long int ans=pow(a,b);
long long int result=ans%c;
cout<<result;
return 0;

}

Hello @vashishthkuntal.gajjar2019 as the test cases are larger so you cant use the power function to fund the power instead you should use your own function which calculated the power.
Here for your reference i am attaching the code:


if you have any doubt you can ask here:
Happy Learning!!

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.