the code below gives me the same answer in online compiler but in coding blocks it printing some address of garbage value i suppose.
#include
#include <bits/stdc++.h>
using namespace std;
int main() {
int n;
cin>>n;
int num=0;
int arr[n+10];
int brr[n+10];
int crr[100];
int alt;
for(int i =0;i<n;i++){
cin>>arr[i];
}
for(int i=0;i<n;i++){
num ^=arr[i];
}
int check=0;
while(num&1!=1){
check++;
num>>1;
}
int m=0;
for(int i=0;i<n;i++){
int dumb =arr[i];
dumb>>check;
if(dumb&1==1){
brr[m] = arr[i];
m++;
}
}
alt =num;
for(int i=0;i<m+1;i++){
num ^=brr[i];
}
crr[0]=num;
num ^=alt;
crr[1]=num;
sort(crr,crr+2);
cout<<crr[0]<<" "<<crr[1];
return 0;
}