i need program to check matrix is symmetric or not??
Answers
Answered by
1
If matrix is equal to its transpose,it is called symmetric matrix...
Answered by
1
C PROGRAM: TO CHECK WHETHER A MATRIX IS SYMMETRIC OR NOT
CODING:
#include<conio.h>
#include<stdio.h>
void main()
{
int a[10][10],i,j,m;
clrscr();
printf("Enter order of square matrix: ");
scanf("%d",&m);
for(i=1;i<=m;i++)
{
for(j=1;j<=m;j++)
{
printf("Enter value of a[%d][%d]: ",i,j);
scanf("%d",&a[i][j]);
}
}
for(i=1;i<=m;i++)
{
for(j=1;j<=m;j++)
{
if(a[i][j]!=a[j][i])
{
printf("\n\nMatrix is not symmetric");
getch();
exit(0);
}
}
}
printf("\n\nMatrix is symmetric");
getch();
}
Read more: http://www.noexit4u.com/2013/02/c-program-to-check-whether-matrix-is.html#ixzz5GJbFy46f
CODING:
#include<conio.h>
#include<stdio.h>
void main()
{
int a[10][10],i,j,m;
clrscr();
printf("Enter order of square matrix: ");
scanf("%d",&m);
for(i=1;i<=m;i++)
{
for(j=1;j<=m;j++)
{
printf("Enter value of a[%d][%d]: ",i,j);
scanf("%d",&a[i][j]);
}
}
for(i=1;i<=m;i++)
{
for(j=1;j<=m;j++)
{
if(a[i][j]!=a[j][i])
{
printf("\n\nMatrix is not symmetric");
getch();
exit(0);
}
}
}
printf("\n\nMatrix is symmetric");
getch();
}
Read more: http://www.noexit4u.com/2013/02/c-program-to-check-whether-matrix-is.html#ixzz5GJbFy46f
Similar questions
Political Science,
8 months ago
Math,
8 months ago
Math,
8 months ago
Science,
1 year ago
Math,
1 year ago
Social Sciences,
1 year ago