processes and shared memory

Hi again!
I have 2 questions ..:

How can i create exactly one number of processes ?
For example i want to create l*n processes and i tried this:

for(i=0;i<l*n;i++){
pid=fork()}

But it creates more than l*n

Also, i want each child to run another x.c program with 3 command line arguments(row,column and segment_id) using execvp() , but i can't do it.
In the x.c i have to multiply 2 arrays(A[l][m],B[m][n] different dimensions) and save the result to C[l][n] array.
I have the A and B arrays in the main program and i created a C array in shared memory like this:

int segment_id=shmget(IPC_PRIVATE,1024,S_IRUSR|S_IWUSR);
int *C[l][n];		
C[l][n]=(int *)shmat(segment_id,NULL,0);

Any help ??

If this is not homework - School work , why are you posting here?
If it is then please follow the rules: fill in the template you see here:

It is not your first post here so please understand:
This is VERY important since the forum has an agreement (with many Education...) to let students post here, but only at that condition...
So thread closed unless you say it is not homework in which case it has nothing to do here...

I will accept to open it here under the very condition of you stating which school etc.. and you are learning and wanting some help as student (very good, welcome!) and this is not or related to an assignment in which case you agree to open a new thread and comply to the requirements.