Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and medical aesthetics - C language programming, a two-dimensional integer array with 3 rows and 4 columns is defined.
C language programming, a two-dimensional integer array with 3 rows and 4 columns is defined.
# Contains? & ltstdio.h & gt

int? Master ()

{

int? a[3][4];

int? l[3]={0},c[4]={0},s = 0;

int? I,j;

For (me? =? 0; ? Me? & lt? 3; i++)

{

For (j? =? 0; ? j? & lt? 4; ? j? ++)

{

scanf("%d ",& ampa[I][j]);

s+= a[I][j];

l[I]+= a[I][j];

c[j]+= a[I][j];

}

}

Printf ("sum of elements in each row:");

For (me? =? 0; ? Me? & lt? 3; ? Me? ++)

printf("%d?" ,? l[I]);

Printf ("\ nTotal of column elements:");

For (me? =? 0; ? Me? & lt? 4; ? Me? ++)

printf("%d?" ,? c[I]);

Printf ("\ nSum of all elements:% d \ nAverage value of all elements: %lf\n",? s,? s/ 12.0);

Return? 0;

}