hi, i have a problem with this, please be sure that this is not to ask for answer, this is to ask for what i want to do
actually i have written some of the code but i have stuck with ...can someone give me some advice on what should i do. i am not asking for answer...
this is my code:
Code:#include <iostream> #include <cstdlib> using namespace std; int main() { int n; cout<<"Please enter how many integers per line [ 1 < 100 ]: "; cin>>n; int row = n; int col = n; int matrix[row][col]; //assign limitation between values if(n<100 && n>0) { //initialize and insert values into the matrix for(int row = 0; row < n; row++) { for(int col = 0; col < n; col++) cin>>matrix[row][col]; } //sum each row for(int row = 0; row < n; row++) { int sumRow = 0; for(int col = 0; col < n; col++) { sumRow = sumRow + matrix[row][col]; cout<<"sum of row "<<row+1<<" = "<<sumRow<<endl; } //sum each column for(int col = 0; col < n; col++) { int sumColumn = 0; for(int row = 0; row < n; row++) sumColumn = sumColumn + matrix[row][col]; cout<<"sum of column "<<col+1<<" = "<<sumColumn<<endl; } //check parity } else { return 1; } system("pause"); return 0; }



LinkBack URL
About LinkBacks


