I am not able to find error in my code (pair sum)

#include<bits/stdc++.h>
using namespace std;
void pairSum(int arr[], int n, int target)
{
int left = 0;
int right = n - 1;
while (left < right)
{
int sum = arr[left] + arr[right];
if (sum > target)
{
right++;
}
else if (sum < target)
{
left–;
}
else
{
cout << arr[left] << " and " << arr[right] << endl;
left–;
right++;
}
}
}
int main() {
int n;
cin>>n;
int arr[1000];
//int cs=0;
//t ms=0;
for(int i=0;i<n;i++)
{
cin>>arr[i];
}
int target;
cin>>target;
pairSum(arr,n,target);
return 0;
}

i am not understand what is the problem in my code

hi @techarun121_523aa3514e575ce9 updated https://ide.codingblocks.com/s/667255

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.