Advertisement
Guest User

Untitled

a guest
Jul 20th, 2017
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.30 KB | None | 0 0
  1. #include<stdio.h>
  2. int searchOdd(int a[], int n)
  3. {
  4. int res=0;
  5. for(int i=0;i<n;i++)
  6.  
  7. res=res^ a[i];
  8.  
  9. return res ;
  10.  
  11. }
  12.  
  13. int main()
  14. {
  15. int result;
  16. int a[]= {2, 3, 5, 4, 5, 2, 4, 3, 5, 2, 4, 4, 2};
  17. int n =sizeof(a)/sizeof(a[0]);
  18. result =searchOdd(a, n);
  19. printf("%d", result);
  20. return 0;
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement