# calculating elements of arrays

• 11-02-2003
Kristin
calculating elements of arrays
Hi, can someone help me with this?

I am a student and we're working on this assignment. We are to write a program that declares three two-dimensional arrays, named first, second, and third. Initialize the first array when it is declared.

Calculate each element in the second array by taking 27% of each element in the first array. Use pointer notation in this function. Send the name of the first array and the name of the second array as arguments to the function. This function will not return any value.

Add the first array to the second array and place the sum in the third array. Use array notation in this function. Send the name of the first array, the name of the second array, and the name of the third array as arguments to the function. This function won't return any value.

Use the following data to initialize only the first array in main.
1.0 4.0 7.0 10.0
2.0 5.0 8.0 11.0
3.0 6.0 9.0 12.0

use the #define to set up constants for the number of rows and columns in the array:
#define r 3
#define c 4.

• 11-02-2003
Salem
So can you do any of your homework at all, or are you completely helpless in this task?

```/* Process */ a = someval; b = a * .27; c = a + b;```
```/* Process */ for ( i = 0; i < r; i++ ) {   for ( j = 0; j < c; j++ ) {     b[i][j] = a[i][j] * .27;     c[i][j] = a[i][j] + b[i][j];   } }```