Code:
int money[MAXNAME][MAXDEPT];
int numNames, numDept, i, j;
char name[MAXLEN+1];
char dept[MAXLEN+1];
char exec[MAXLEN+1];
scanf("%d", &numNames); //read number of executives
for(i=0;i<numNames;i++){
scanf("%s", name); // scan for names of executives.
scanf("%d", &numDept); // read number of departments.
for(j=0;j<numDept;j++){
scanf("%s", dept);// scan for names of deptment.
}
}
for(i=0; i<numNames; i++){
for(j=0; j<numDept; j++){
scanf("%d", &money[i][j]); // money embezzled assigned to each dept and name
}
}
printf("Mr.%s has embezzled $%d.\n", name, money[i][j]);
return 0;
at the end i am trying to get it to print the two last names along with how much total money they have embezzled. can someone help me.