Advertisement
Kawsar_Hossain

Array-Problem 5

Jun 21st, 2019
109
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.33 KB | None | 0 0
  1. #include <stdio.h>
  2. int main()
  3. {
  4. int a[10],i,j,count=0;
  5. for (i=0;i<10;i++)
  6. {
  7. scanf("%d", &a[i]);
  8. }
  9. for (i=0;i<10;i++)
  10. {
  11. for(j=i+1;j<10;j++)
  12. {
  13. if(a[i]==a[j])
  14. {
  15. count++;
  16. break;
  17. }
  18. }
  19. }
  20. printf("Total number of duplicate elements=%d", count);
  21. return 0;
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement