Not getting right output

#include
#include

using namespace std;

int main(){

int m;
cin >> m;

int arr[1000];

bool checker=false;

for(int i=0;i<m;i++) {
    cin >> arr[i];
}

cin.get();

int target;
cin >> target;

int i=0,j=m-1;
while(i<j) {
    int sum=arr[i]+arr[j];

    if(sum==target) {
        cout << "found" << endl;
        checker=true;
        cout << "i=" << i << " j=" << j;
		i++;
		j--;
    }
    else if(sum>target) {
        j--;
    }
    else if(sum<target) {
        i++;
    }
}

if(checker==false) {
    cout << "not found";
}

return 0;

}

@premang
you need to print values but u are printing indices.

changed but still not getting second case, it is just printing first case only

pls share ur updated code using cb ide

https://www.codepile.net/pile/3D2rL9Do

sort ur array because input array need not to be sorted