To understand how FOR() works you can read 6 ways to solve the problem ( Reverse an array ) using FOR()

Version 1 :
C Code:
  1.  #include <stdio.h>
  2.  int main(void)
  3.  {
  4.      int A[100];  // simply use an integer array
  5.      int  i, j, n;
  6.      float c;
  7.      
  8.      printf("\n How many elements do you want ? ");scanf("%d",&n);
  9.      for ( i = 0 ; i < n ; i++ )
  10.      {      printf("\n A[%d] = ", i + 1 ); scanf("%d",&A[i]);   }
  11.  
  12.      for ( i = 0, j = n-1 ; i < j ; ++i, --j)
  13.      {
  14.           c = A[i]; A[i] = A[j] ; A[j] = c;
  15.      }
  16.      printf("\n The reversed array is : ");
  17.      for ( i = 0 ; i < n ; i++ ) printf("  %3d ",A[i]);
  18.      return 0;
  19. }

Version 2 :
C Code:
  1.  #include <stdio.h>
  2.  int main(void)
  3.  {
  4.      int A[100];  // simply use an integer array
  5.      int  i, j, n;
  6.      float c;
  7.      
  8.      printf("\n How many elements do you want ? ");scanf("%d",&n);
  9.      for ( i = 0 ; i < n ; i++ )
  10.      {      printf("\n A[%d] = ", i + 1 ); scanf("%d",&A[i]);   }
  11.  
  12.      for ( i = 0, j = n-1 ; i < j ; c = A[i] , A[i] = A[j] , A[j] = c , ++i, --j)
  13.          
  14.      printf("\n The reversed array is : ");
  15.      for ( i = -1 ; ++i <n ;  ) printf("  %3d ",A[i]);
  16.      return 0;
  17. }

Version 3 :
C Code:
  1. #include <stdio.h>
  2.  int main(void)
  3.  {
  4.      int A[100];  // simply use an integer array
  5.      int  i = -1, j, n;
  6.      float c;
  7.      
  8.      printf("\n How many elements do you want ? ");scanf("%d",&n);
  9.      for ( i = 0 ; i < n ; i++ )
  10.      {      printf("\n A[%d] = ", i + 1 ); scanf("%d",&A[i]);   }
  11.  
  12.      for ( ; n - 1 - ++i , i < j ; )
  13.      {
  14.           c = A[i]; A[i] = A[j] ; A[j] = c;
  15.      }
  16.      printf("\n The reversed array is : ");
  17.      for ( i = 0 ; i  -  n ; ) printf("  %3d ",A[i++]);
  18.      return 0;
  19. }

Version 4 :
C Code:
  1. #include <stdio.h>
  2.  int main(void)
  3.  {
  4.      int A[100];  // simply use an integer array
  5.      int  i = 0, j = n-1, n;
  6.      float c;
  7.      
  8.      printf("\n How many elements do you want ? ");scanf("%d",&n);
  9.      for ( i = 0 ; i < n ; i++ )
  10.      {      printf("\n A[%d] = ", i + 1 ); scanf("%d",&A[i]);   }
  11.  
  12.      for ( ; ; )
  13.      {
  14.           c = A[i]; A[i] = A[j] ; A[j] = c;
  15.           if ( ++i >= --j ) goto do_next;
  16.      }
  17.      do_next:
  18.      printf("\n The reversed array is : ");
  19.      for ( i = -1 ; i++ < n-1 ; printf("  %3d ",A[i]) );
  20.      return 0;
  21. }

Version 5 :
C Code:
  1. #include <stdio.h>
  2.  int main(void)
  3.  {
  4.      int A[100];  // simply use an integer array
  5.      int  i = 0, j = n-1, n;
  6.      float c;
  7.      
  8.      printf("\n How many elements do you want ? ");scanf("%d",&n);
  9.      for ( i = 0 ; i < n ; i++ )
  10.      {      printf("\n A[%d] = ", i + 1 ); scanf("%d",&A[i]);   }
  11.  
  12.      for ( ; ;)
  13.      {
  14.           c = A[i]; A[i] = A[j] ; A[j] = c;
  15.           if ( ++i >= --j ) break;
  16.      }
  17.      printf("\n The reversed array is : ");
  18.      for ( i = -1 ; i++ < n-1 ;printf("  %3d ",A[i]) );
  19.      return 0;
  20. }

Version 6 :
C Code:
  1. #include <stdio.h>
  2.  int main(void)
  3.  {
  4.      int A[100];  // simply use an integer array
  5.      int  i = 0, j = n-1, n;
  6.      float c;
  7.      
  8.      printf("\n How many elements do you want ? ");scanf("%d",&n);
  9.      for ( i = 0 ; i < n ; i++ )
  10.      {      printf("\n A[%d] = ", i + 1 ); scanf("%d",&A[i]);   }
  11.  
  12.      for ( ; c = A[i], A[i] = A[j] , A[j] = c , ++i < --j ; );
  13.      
  14.      printf("\n The reversed array is : ");
  15.      for ( i = 0 ; printf("  %3d ",A[i]) , ++i - n; );
  16.      return 0;
  17. }