what is wrong with my code, i am getting correct output without runtime error
#include
#include <math.h>
using namespace std;
int main() {
// your code goes here
long long int a,b,c,t,ld;
cin>>t;
while(t–)
{
cin>>a>>b;
if(a==0 &&b==0)
{
ld = 1;
}
else if(b==0)
{
ld = 1;
}
else if(a==0)
{
ld = 0;
}
else
{
c = pow(a,b);
ld=c%10;
}
cout<<ld<<endl;
}
return 0;
}