#include<stdio.h>
#include<conio.h>

void main ()
{
  int a[50][50],m,n,i,j,b[50][50],x;
  clrscr();
  
  printf("Enter the rows and columns.\n");
  scanf("%d%d",&m,&n);
  
  printf("\nEnter the elements to check if the matrix is symmetrical or not.\n");
  
  for(i=1;i<=m;i++)
  for(j=1;j<=n;j++)
  scanf("%d",&a[i][j]);
  printf("\nThe matrix entered is:\n");
  
  for(i=1;i<=m;i++)
  {
    for(j=1;j<=n;j++)
    printf("[%d] ",a[i][j]);
    printf("\n");
  }
  
  for(i=1;i<=m;i++)
  for(j=1;j<=n;j++)
  b[i][j]=a[j][i];
  printf("The transpose of the matrix is:\n");
  
  for(i=1;i<=n;i++)
  {
    for(j=1;j<=m;j++)
    printf("[%d]",b[i][j]);
    printf("\n");
  }
  
  for(i=1;i<=m;i++)
  for(j=1;j<=n;j++)
  if(a[i][j]!=b[i][j])
    x=1;
  if(x==0)
    printf("\nThe matrix is symmetrical.\n");
  else
    printf("\nThe matrix is not symmetrical.");
}