fork download
  1. #include <stdio.h>
  2.  
  3. int main() {
  4.  
  5. int a[8] = {20,25,10,19,20,26,3,9};
  6. int *start = a;
  7. int *end = start+7;
  8.  
  9. for(int i = 0;i<4;i++){
  10.  
  11. int temp = *start;
  12. *start = *end;
  13. *end = temp;
  14.  
  15. start++;
  16. end--;
  17. }
  18.  
  19. for(int i=0;i<8;i++){
  20. printf("%d ",a[i]);
  21. }
  22. return 0;
  23. }
Success #stdin #stdout 0s 5320KB
stdin
Standard input is empty
stdout
9 3 26 20 19 10 25 20