What is the problem with my code?

bhaiyaa can u pls join the google meet link .it wwill be very easy for me to specify my doubt to u.

Hey @sr7.shubhamrai in which question you have issue in?

pair sum problem https://online.codingblocks.com/app/player/174442/content/173381/4812/code-challenge

Tell me the name of the question i will try my best to help you.

target sum problem https://online.codingblocks.com/app/player/174442/content/173381/4812/code-challenge?_ga=2.100789125.584527040.1606747303-640071993.1605080886

#include<iostream>
using namespace std;
void find_pairsum(int arr[], int n, int keysum) {

    for (int i = 0, j = n - 1; i < j;) {
        if (arr[i] + arr[j] == keysum) {
            cout << arr[i] << " and " << arr[j] << endl;
            i++; j--;
        }
        else if (arr[i] + arr[j] > keysum) {
            i++;
        }
        else if (arr[i] + arr[j] < keysum) j--;
    }
   
}
int main() {
    int arr[100] = { 0 }, n, key;

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

    find_pairsum(arr, n, key);
    return 0;
}

whats the problem with my code??

i can’t join this meeting

https://meet.google.com/zha-exve-zxb.
try agin

for(int i=0; i<n-1; i++){
		for(int j=i; j<=n-1; j++){
            if(a[i] + a[j] == target && a[i] != a[j]){
              cout<<a[i]<<" and "<<a[j]<<endl;
			      }
		}
	}

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.