Program to Reverse an Array in C++

Program explanation:

  • Program declare an integer array of size five, initialize it using for loop.
  •  Pass size and array name to function.
  • Function uses for loop and swap array elements with in it.
  •  A for loop is used to display the final result.

    Following is the program to reverse an array.

 

Be the first to comment

Leave a Reply