Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<stdio.h>
- int searchOdd(int a[], int n)
- {
- int res=0;
- for(int i=0;i<n;i++)
- res=res^ a[i];
- return res ;
- }
- int main()
- {
- int result;
- int a[]= {2, 3, 5, 4, 5, 2, 4, 3, 5, 2, 4, 4, 2};
- int n =sizeof(a)/sizeof(a[0]);
- result =searchOdd(a, n);
- printf("%d", result);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement