Advertisement
Guest User

Untitled

a guest
Jan 18th, 2020
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.42 KB | None | 0 0
  1. #include <stdio.h>
  2.  
  3. int main()
  4. {
  5. int size = 8;
  6. int i,j,n = 0;
  7.  
  8.  
  9. int arr[] = {10,10,10,10,12 ,12 ,13,10};
  10.  
  11.  
  12.  
  13. for(i = 0; i < size; i++ )
  14. {
  15. for(j = i+1; j < size;j++)
  16. {
  17. if(arr[i] == arr[j])
  18. {
  19. n++;
  20. break;
  21. }
  22.  
  23.  
  24. }
  25.  
  26.  
  27.  
  28.  
  29.  
  30. }
  31.  
  32. printf("The no. of duplicates are %d",n );
  33.  
  34.  
  35. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement