I am trying to solve a problem. where the user will give the input an integer then squaring it I have to find the mod. But when I give big integer pow() is giving the wrong answer. How can i fix that?
#include<bits/stdc++.h>
using namespace std;
int main()
{
//ios_base:: sync_with_stdio(false);
//cin.tie(NULL);
int t;
cin>>t;
for(int i=0;i<t;i++)
{
long long n;
cin>>n;
long long sn=0;
sn=pow(n,2);
long long v = pow(10,9)+7;
cout<<sn%v<<endl;
}
}