#include <stdio.h>
#include <string.h>
float cal_row_sum (float[][4],float*[][4]);
float cal_col_sum (float[][4],float*[]);
void print_total
(char[][15],float[][4],float*[][4],float*[]);
void main(){
char
name[3][15];
float sales[3][4];
float quarterly_sale[1][4];
float personal_sale[3];
quarterly_sale[1][4] = cal_row_sum(sales,&quarterly_sale);
personal_sale[3] = cal_col_sum(sales,&personal_sale);
print_total(name[][15],sales[][4],&quarterly_sale[][4],&personal_sale[]);
return 0;
}
float cal_row_sum( float sales[][4],float *quarterly_sale[][4]){
int r,c;
for(r=0; r<3;r++){
for(c=0;c<4;c++){
scanf("%f",&sales[r][c]);
}
}
*quarterly_sale[1][c]= sales[r][c];
return *quarterly_sale[][c];
}
float cal_col_sum(float sales[][4],float* personal_sale[][4]){
int r,c;
for(r=0; r<3;r++){
for(c=0;c<4;c++){
scanf("%f",&sales[r][c]);
}
}
*personal_sale[r] = sales[r][c];
return *personal_sale[];
}
void print_total(char name[][15],float sales[][4],float *quarterly_sales[][4],float *personal_sale[]){
int r,c;
for(r=0; r<3;r++){
scanf("%c",&name[r])
for(c=0;c<4;c++){
scanf("%f",&sales[r][c]);
}
}
float total;
for (r=0;r<3;r++){
scanf("%f",personal_sale[r];
total += personal_sale[r];
}
printf("\t Name
\t First Quarter
\t Second Quarter
\t Third Quarter
\t Fourth Quarter
\t Personal Sales\n");
scanf ("%c %f %f",&name[r][15],&sales[r][c],&personal_sale[r]);
printf("\t Quarterly sale:");
scanf("%f",&quarterly_sales[][c]);
printf("------------------------------------------------------------------------------------------------------------------");
printf("Total:
%0.2f
",total);
}