MAT4m

Untitled

Jan 13th, 2019
56
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.44 KB | None | 0 0
  1. #include<stdio.h>
  2. int main()
  3. {
  4. int x [5]={1,3,4,0,2};
  5. int y [5]={2,4,3,1,0};
  6. int i;
  7. for(i=0; i<5; i++)
  8. {
  9. x[i] = x[y[i]];
  10. }
  11. printf("Array x ={");
  12. for(i=0;i<5;i++)
  13. {
  14. printf("%d,", x[i]);
  15. }
  16. printf("} \n");
  17. printf("Array y ={");
  18. for(i=0;i<5;i++)
  19. {
  20. printf("%d,", y[i]);
  21. }
  22. printf("} \n");
  23. return 0;
  24. // Answer x = 4 2 0 2 4
  25. }
Add Comment
Please, Sign In to add comment