-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathHA 5.6.cpp
More file actions
45 lines (42 loc) · 883 Bytes
/
Copy pathHA 5.6.cpp
File metadata and controls
45 lines (42 loc) · 883 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#include<stdio.h>
int main()
{
int i, j, rows, columns, a[10][10], b[10][10], c = 1;
printf("Enter the number of rows and columns:\n ");
scanf("%d %d", &i, &j);
printf("Enter the matrix elements:\n");
for(rows = 0; rows < i; rows++)
{
for(columns = 0;columns < j;columns++)
{
scanf("%d", &a[rows][columns]);
}
}
for(rows = 0; rows < i; rows++)
{
for(columns = 0;columns < j; columns++)
{
b[columns][rows] = a[rows][columns];
}
}
for(rows = 0; rows < i; rows++)
{
for(columns = 0; columns < j; columns++)
{
if(a[rows][columns] != b[rows][columns])
{
c++;
break;
}
}
}
if(c == 1)
{
printf("\n The Matrix is a Symmetric Matrix. ");
}
else
{
printf("\n The Matrix is Not a Symmetric Matrix. ");
}
return 0;
}