-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdstl6.c
More file actions
62 lines (57 loc) · 1.13 KB
/
dstl6.c
File metadata and controls
62 lines (57 loc) · 1.13 KB
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
#include<stdio.h>
void main()
{
int m,n,i,j,SYM=1;
printf("enter the size of matrix");
scanf("%d%d", &m,&n);
printf("enter the matrix\n");
int a[m][n];
for(i=0;i<m;i++)
{
for(j=0;j<n;j++)
{
scanf("%d", &a[i][j]);
}
}
int b[m][n];
for(i=0;i<m;i++)
{
for(j=0;j<n;j++)
{
b[i][j] = a[j][i];
}
}
for(i=0;i<m;i++)
{
for(j=0;j<n;j++)
{
if(a[i][j] != b[i][j])
SYM=0;
break;
}
}
if(SYM==1)
{
for(i=0;i<m;i++)
{
for(j=0;j<n;j++)
{
printf("%d\t", &a[i][j]);
}
printf("\n");
}
printf("the matrix is symmetric\n");
}
else
{
for(i=0;i<m;i++)
{
for(j=0;j<n;j++)
{
printf("%d\t", &a[i][j]);
}
printf("\n");
}
printf("the matrix is not symmetric\n");
}
}