Heres an example since A is a square matrix while B and C is not. The program on my head is a row and a colum counter then if the row and colum is equal to eachother then the system will print out that the A matrix is a square matrix and both B and C are not. Is their efficent way on doing this?

            {7, 2, 1}, 
A =         {0, 4, 2},
            {5, 7,11}                                  {1        },  
                                                   C = {2,  3,  4},
                                                       {5,  6    }
          {1, 4},
B =       {2, 8},
          {1, 6,}

If you store it as a 2D array in Java then it's easy.
Remember htat a 2D array is really an array of arrays, so all you need is the check that the length of each inner array is the same as the length of the outer array. No need to count anything. You won't find anything more efficient than that.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.