Determine if an array is square matrix or not.

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,}