C Ass57
C Ass57
#include <stdio.h>
#include <conio.h>
#include <stdlib.h>
void main()
{
int A[10][10], B[10][10];
int i, j, R1, C1, R2, C2, flag =1;
printf("MATRIX A is\n");
for(i=0; i<R1; i++)
{
for(j=0; j<C1; j++)
{
printf("%3d",A[i][j]);
}
printf("\n");
}
printf("MATRIX B is\n");
for(i=0; i<R2; i++)
{
for(j=0; j<C2; j++)
{
printf("%3d",B[i][j]);
}
printf("\n");
}
if(flag == 1 )
printf("Two matrices are equal\n");
else
printf("But,two matrices are not equal\n");
/*------------------------------------------------------
Output
Enter the order of the matrix A
2 2
Enter the order of the matrix B
2 2
Enter the elements of matrix A
1 2
3 4
Enter the elements of matrix B
1 2
3 4
MATRIX A is
1 2
3 4
MATRIX B is
1 2
3 4
Matrices can be compared
Two matrices are equal
-------------------------------------------------------*/