#include<bits/stdc++.h>
using namespace std;
int power1(int a, int b, int c)
{
if(b%2==0)
return (power1(a,b/2)%c * power1(a,b/2)%c)%c;
else
return (power1(a,b/2)%c * power1(a,b/2)%c * a)%c;
}
int main()
{
ios_base::sync_with_stdio(false); cin.tie(NULL);
long long int t;
cin>>t;
while(t--)
{
int a, b, c;
cin>>a>>b>>c;
cout<<power1(a,b,c)<<endl;
}
return 0;
}
Getting this error. Please clarify the issue!
prog.cpp: In function ‘int power1(int, int, int)’:
prog.cpp:6:29: error: too few arguments to function ‘int power1(int, int, int)’
return (power1(a,b/2)%c * power1(a,b/2)%c)%c;
^
prog.cpp:3:5: note: declared here
int power1(int a, int b, int c)
^
prog.cpp:6:47: error: too few arguments to function ‘int power1(int, int, int)’
return (power1(a,b/2)%c * power1(a,b/2)%c)%c;
^
prog.cpp:3:5: note: declared here
int power1(int a, int b, int c)
^
prog.cpp:8:29: error: too few arguments to function ‘int power1(int, int, int)’
return (power1(a,b/2)%c * power1(a,b/2)%c * a)%c;
^
prog.cpp:3:5: note: declared here
int power1(int a, int b, int c)
^
prog.cpp:8:47: error: too few arguments to function ‘int power1(int, int, int)’
return (power1(a,b/2)%c * power1(a,b/2)%c * a)%c;
…