The simple program Reads and traverse, write arrays and reverse the elements in an integer array.
[sourcecode language=’cpp’]
* MYCPLUS Sample Code – *
* *
* This code is made available as a service to our *
* visitors and is provided strictly for the *
* purpose of illustration. *
* *
* Please direct all inquiries to saqib at *

#define NMAX 10

void intSwap(int *x, int *y);
int getIntArray(int a[], int nmax, int sentinel);
void printIntArray(int a[], int n);
void reverseIntArray(int a[], int n);

int main(void) {
int x[NMAX];
int hmny;

hmny = getIntArray(x, NMAX, 0);
printf(“The array was: \n”);
printf(“after reverse it is:\n”);

void intSwap(int *x, int *y)
/* It swaps the content of x and y */
int temp = *x;
*x = *y;
*y = temp;

void printIntArray(int a[], int n)
/* n is the number of elements in the array a.
* These values are printed out, five per line. */
int i;

for (i=0; i