Advertisement
kamandos

HomeWork2

Jul 13th, 2022
744
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.47 KB | None | 0 0
  1. #include <stdio.h>
  2.  
  3. void symmetric_array_pair(int arr1[], int arr2[], int m, int n)
  4. {
  5. int i,j;
  6. for(i=0;i<m;i++)
  7. {
  8. for(j=0;j<m;j++)
  9. {
  10. if(arr1[i] == arr2[j] && arr1[j]== arr2[i])
  11. {
  12. printf("(%d,%d)\t",arr1[i],arr1[j]);
  13. continue;
  14. }
  15. }
  16. }
  17. }
  18.  
  19. int main()
  20. {
  21. int m,n;
  22. scanf("%d%d",&m,&n);
  23. int i,j;
  24. int arr1[m],arr2[n];
  25.  
  26. for(i=0;i<m;i++)
  27. {
  28. scanf("%d",&arr1[i]);
  29. }
  30.  
  31. for(i=0;i<m;i++)
  32. {
  33. scanf("%d",&arr2[i]);
  34. }
  35.  
  36. symmetric_array_pair(arr1,arr2,m,n);
  37.  
  38. return 0;
  39. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement