Page 589 - Computer science 868 Class 12
P. 589
52 }
53 System.out.println();
54 }
55 }
56 void symmetric()
57 {
58 int i,j,f=0;
59 for(i=0;i<m;i++)
60 {
61 for(j=0;j<n;j++)
62 {
63 if(arr[i][j]!=ar[j][i])
64 f=1;
65 }
66 }
67 if(f==0)
68 {
69 System.out.print("Symmetric");
70 }
71 else
72 {
73 System.out.println("Not Symmetric");
74 }
75 }
76 }
Output of the preceding program is as follows:
Original Matrix is:
1 2 3
4 5 6
7 8 9
The Transpose Matrix is:
1 4 7
2 5 8
3 6 9
Not Symmetric
587
Internal Assessment 587

