**QUESTION**

Given an sorted array A[i] of N positive integers having all the numbers occuring exactly twice, except for one number which will occur only once. Find the number occuring only once.\n\nInput\n\nThe first line of input contains an integer T denoting the number of test cases. Then T test cases follow. \n\nThe first line of each test case contains a positive integer N, denoting the size of the array.\n\nThe second line of each test case contains a N positive integers, denoting the elements of the array.\n\n\nOutput\n\nPrint out the singly occurring number.\n\nConstraints\n1 <= T <= 100\n0 < N <= 100\n0 <= A[i] <= 100.

**ANSWER**

```
#include <stdio.h>
int main()
{
int T,res=0;
scanf("%d",&T);
while(T--)
{
int i,N,A[10];
scanf("%d",&N);
for(i=0;i<N;i++)
{
fscanf(stdin,"%d",&A[i]);
res=getsingle(A,N);
}
printf("%d\n",res);
}
return 0;
}
int getsingle(int A[],int N)
{
int i;
int common_bit_mask=0;
for(i=0;i<N;i++)
{
common_bit_mask=common_bit_mask^A[i];
}
return common_bit_mask;
}
```