Lab 3
Lab 3
CODE:
int main()
{
clock_t start=clock();
int m,n;
printf("Enter no of rows and columns of two matrices : ");
scanf("%d %d",&m,&n);
int mat1[m][n],mat2[m][n];
printf("Enter Matrix 1: \n");
for(int i=0;i<m;i++){
for(int j=0;j<m;j++){
scanf("%d",&mat1[i][j]);
}
}
printf("Enter Matrix 2: \n");
for(int i=0;i<m;i++){
for(int j=0;j<m;j++){
scanf("%d",&mat2[i][j]);
}
}
multiplication(m,n,mat1,mat2);
int main()
{
clock_t start = clock();
int m, n;
printf("Enter no of rows and columns of the matrix : ");
scanf("%d %d", &m, &n);
int mat1[m][n];
printf("Enter Matrix : \n");
for (int i = 0; i < m; i++)
{
for (int j = 0; j < m; j++)
{
scanf("%d", &mat1[i][j]);
}
}
if (m != n)
{
printf("Matrix is not Orthogonal\n");
}
else
{
orthogonal(m, mat1);
}
OUTPUT: