Advertisement
Guest User

Untitled

a guest
Dec 14th, 2018
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.64 KB | None | 0 0
  1.  
  2. #include <iostream>
  3. using namespace std;
  4. int main ()
  5. {
  6. int x [10], y[10];
  7. int counter1;
  8. int counter2;
  9. cout << "Enter the first 10 numbers: " <<endl;
  10. for (int k=0; k<=9; k++)
  11. {
  12. cin>> x[k];
  13. } ;
  14. cout << "Enter the second 10 numbers: " <<endl;
  15. for (int i=0; i<=9; i ++)
  16. {
  17. cin >> y[i];
  18. }
  19. for (int i=0; i<=9; i++)
  20. {
  21. for (int j=0; j<=9;j++)
  22. {
  23. if( x[i] == y[j] )
  24. {
  25. j++;
  26. cout << x[i] << "its index is: " << i << endl;
  27. cout << y[j] <<"its index is: " <<j <<endl;
  28. }
  29.  
  30. }
  31. }
  32. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement