1.

Write a user defined function in C++ to display the sum of column elements of two dimensional array R[7][7] containing integers.

Answer»

void COLSUM(int R[7][7])

{int SUMC;

for (int j=0;j<7;j++)

{

SUMC=0;

for(int i=0;i<7;i++)

SUMC=SUMC + R[i][j];

Cout<< "Sum of Column "<<j<<" = "<<SUMC ;

}

}



Discussion

No Comment Found

Related InterviewSolutions