Why 2 test cases are not working

#include

using namespace std;

int main() {

int N,sum,i,j,t;
cin>>N;
signed int arr[1000];
for(i=0;i<N;i++)
{
	cin>>arr[i];
}
cin>>t;
for(i=0;i<N-1;i++)
{
	for(j=i+1;j<N;j++)
	{
		sum=0;
		sum+=arr[i]+arr[j];
		if(sum==t)
		{
			cout<<arr[i]<<" "<<"and"<<" "<<arr[j]<<endl;
		}
	}
}
return 0;

}

@ritik_99
hello Sndarbh,
In ur output print smaller number first and then bigger number.

for ex-> if answer is 2,3 then print 2 and 3 . . . . . . 3 and 2 will give wa

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.