Divisible subarray . the output is wrong .pls help understand whats wrong with this code

int main() {
int t;
cin>>t;

while(t--){
	int n;
	cin>>n;
	int mod[n];  // array tat store csum%n at each point
	 
	for(int i=0;i<n;i++){
		mod[i]=0;
	}
	int csum=0;// cumilative sum upto a point 
	int rem;
	int ans=0;
	mod[0]=1;
	for(int i=0;i<n;i++){
		int x;
		cin>>x;
		csum+=x;
		rem=csum%n;
		mod[rem]+=1;
		
	}
	/
	for(int j=0;j<n;j++){
		if(mod[j]>=2){
			int k=(mod[j]*mod[j]-1)/2;
          ans+=k;
		}
	}
	
	cout<<ans<<endl;
	ans=0;
	csum=0;
}
return 0;

}

for(int j=0;j<n;j++){
if(mod[j]>=2){
int k=(mod[j]*mod[j]-1)/2;
ans+=k;
}
}
Here you typed
k=(mod[j] * mod[j]-1)/2
Instead of k=mod[j] * (mod[j] -1)/2

Case of missed brackets
Try correct it

hi @vaishnavi20001611 have you re-opened this doubt?