Quote Originally Posted by swoopy
Have you written code to check the matrix for the parity property? To do this, you need to add up each row and column. Try this, then post some code if it's not working.

I would highly recommend you break up you program into functions. For example make a function to check for parity. This will make it much easier.
hi this is the code that i make into function but some error, can you please help me?

Code:
#include <iostream>
#include <cstdlib>
using namespace std;
int ma(int n);

int main()
{
    int n;    
    
    cout<<"Enter: ";
    cin>>n;

    int matrix[n][n];
//======================= initialise and insert values ========================= 
    cout << "Enter the matrix by rows\n";  
    for(int row = 0; row < n; row++)
        for(int col = 0; col < n; col++)
        cin >> matrix[row][col];
//========================= sum of each row ====================================
    cout<<ma(n);
    
system("pause");
return 0;
}

int ma(int n)
{
    int row;
    int col;
    int matrix[row][col];

    
    for(row = 0; row < n; row++)
    {    
        int sumRow = 0;

        for(col = 0; col < n; col++)

        sumRow = sumRow + matrix[row][col];
        cout<<"sum of row "<<row+1<<" = "<<sumRow<<endl; 
    }   
}