## Code to Manipulate Values Inside Arrays

### Code to Find the Maximum Value in an Array

```int[] a = new int[N];
//N can be anything and you can initialize
//this array with any values you want.
double max = a;
for(int i = 1; i < a.length; i++) {
if(a[i] > max) max = a[i];
}```

### Code to Find the Average of the Elements in an Array

```int[] a = new int[N];
//N can be anything and you can initialize
//this array with any values you want.
double sum = 0.0;
for(int i = 0; i < N; i++) {
sum += a[i];
}
double average = sum / N;```

### Code to Copy all of the Elements in an Array to another Array

```double[] a = new double[N];
//N can be anything and you can initialize
//this array with any values you want.

double[] b = new double[N];
for(int i = 0; i < N; i++) {
b[i] = a[i];
}```

### Code to Reverse the Elements in an Array

```int[] a = new int[N];
//N can be anything and you can initialize
//this array with any values you want.
for(int i = 0; i < N/2; i++) {
int temp = a[i];
a[i] = a[N-i-1];
a[N-i-1] = temp;
} ```