fork download
  1. #include <stdio.h>
  2. // REVERSE 1ST to 4TH INDICIES
  3. int main(void) {
  4. int arr[7]={1,2,3,4,5,6,7};
  5.  
  6. for(int i=1,j=4;i<=j;i++,j--){
  7. int temp=arr[i];
  8. arr[i]=arr[j];
  9. arr[j]=temp;
  10. }
  11.  
  12. for(int i=0;i<7;i++){
  13. printf("%d" ,arr[i]);
  14. }
  15. return 0;
  16. }
  17.  
Success #stdin #stdout 0.01s 5324KB
stdin
Standard input is empty
stdout
1543267