#include
using namespace std;
int main() {
int a,b, c;
cin>>a>>b>>c;
int ans = 1;
a = a%c;
for(int i = 1; i<=b;i++)
{
ans = (ans * a)%c;
}
}
I dont what is wrong with my code 1 test case always get failed
#include
using namespace std;
int main() {
int a,b, c;
cin>>a>>b>>c;
int ans = 1;
a = a%c;
for(int i = 1; i<=b;i++)
{
ans = (ans * a)%c;
}
}
I dont what is wrong with my code 1 test case always get failed
Your code is failing large test cases
For Eg:
Input: 967891 9234 198011
Your O/P: -116687
Correct O/p: 159864
This video teaches an interesting concept, refer it:
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.