1. ## arrays and functions

Code:
```ok so im trying to get my head around all this c stuff..
if i had inputs from a user say...

3 4 5
2 4 7

and i wanted to compute the sqrt of each row summed, plus the number of loops occuring, how would i add 3 parallel arrays and write a loop to read in the values?
so far i have this code but it isnt in the format of an array or function. i have tried to do it but im not getting the correct output

int
main (int argc, char **argv){

double x, y, z, a, b;
int n;

n=0;

scanf("%lf %lf %lf", &x, &y, &z);

a=x+y+z;
b=sqrt(a);
n=1;
while(scanf("%lf %lf %lf", &x, &y, &z)==3){
if (n>0){
a=x+y+z;
b=sqrt(a);
n+1;

}

printf("%f, %f", a,b);
return 0;
}```

2. I'm not sure what your question is, exactly, because "adding 3 parallel arrays" is neither necessary nor desirable if the problem is computing the square root of the sum of a row of a matrix.

As to input, do you know ahead of time how many numbers to read in? That will tell you how your loop will run. If you don't, then the first thing you should input is how many numbers you are going to read in so that you can write the loop.

3. The first thing you will want to do then is put this stuff in an array:
Code:
```int array[3];
scanf("%lf %lf %lf", &array[0], &array[1], &array[2]);```
Which makes it much easier to iterate thru using a loop:
Code:
`for (i=0;i<3;i++) printf("%d\t",array[i]);`
Meaning your task will be even easier with a two dimensional array, to hold multiple arrays. If you do not know how many arrays there will be, you use a **pointer to an array of pointers (each of those is to an array). But work one step at a time or you will waste time writing tons of code that does not work.

Do look at the program I gave you earlier, it may seem complicated right now but there are lots of examples of the correct syntax for performing the kind of tasks common to handling "matrices" (multi dimensional arrays).

4. thanks for the quick response....however that previous code u gave me is alot more complicated
if i put all of this in a function, how could i declare an array and alter the reading loop ?