here I am getting in error for odd occurence:
#include
using namespace std;
int findOdd(int arr[], int n)
{
int res = 0, i;
for (i = 0; i < n; i++)
res ^= arr[i];
return res;
}
// Driver Method
int main()
{
int arr[100000];
int n;
cin>>n;
for(int i=0 ; i<n ; i++)
{cin>>arr[i];
}
cout<<findOdd(arr, n)<<" is present only once";
return 0;
}