### Subtraction of Two Matrices

C Program for subtraction of two matrices

#include<stdio.h>
#include<conio.h>

void read_mat(float a[][10],int m,int n)
{
int i,j;
printf("\n\nEnter %d X %d matrix below:\n",m,n);
for(i=0;i<m;i++)
for(j=0;j<n;j++)
scanf("%f",&a[i][j]);
}

//Write Matrix
void write_mat(float a[][10],int m,int n)
{
int i,j;
for(i=0;i<m;i++)
{
for(j=0;j<n;j++)
printf("%10.2f",a[i][j]);
printf("\n");
}
}

//Subtract matrices
void sub_mat(float a[][10],float b[][10],float c[][10],int m,int n)
{
int i,j;
for(i=0;i<m;i++)
for(j=0;j<n;j++)
c[i][j]=a[i][j] - b[i][j];
}

//main function
void main()
{
float x[10][10],y[10][10],z[10][10];
int m,n;
clrscr();

//Accept two matrices
printf("\n\nEnter order of matrix \n");
scanf("%d %d",&m,&n);

//call sub_mat() function
sub_mat(x,y,z,m,n);
printf("\n\nSUBTRACTION OF THE GIVEN MATRICES IS:\n");
write_mat(z,m,n);
getch();
}

1. 2)Subtraction of Two Matrices

2. ID 201610456

1. Subtraction of 2 dimension array using multilevel inheritance
ID201610456

2. ID 201610456
subtraction of 2 dimensional matrix using multilevel inheritance
http://ideone.com/E2Sxu4

3. ID : 201620195
https://www.dropbox.com/s/0sk027rqgq3kb81/02.cpp?dl=0

4. Subtruction of two dimension array following multilevel inheritance
ID 201610456

5. ID: 201710494
https://www.dropbox.com/s/jbvbgoe5xjdco67/2%20Multilevel%20Inheritance.cpp?dl=0

6. http://www.c-programming-blog.com/2014/12/subtraction-of-two-matrices.html?m=1

7. http://www.c-programming-blog.com/2014/12/subtraction-of-two-matrices.html?m=1

8. ID:201610254

#include
using namespace std;

class a
{
public:
a()
{
cout<<"matrix:";

}

};
class b:public a
{
public:
b()
{
{

for(i=0;i<2;i++)
{for(j=0;j<2;j++)
{
cin>>ar[i][j];
}
}
}

{for(i=0;i<2;i++)
{
for(j=0;j<2;j++)
{
cin>>arr[i][j];
}

}
}
}
protected:int arr[2][2],ar[2][2],i,j;
};
class c:public b
{
public:

c()
{
for(i=0;i<2;i++)
{
for(j=0;j<2;j++)
{
cout<<ar[i][j]-arr[i][j]<<" ";
}
}
}
};
int main()
{
c obj;
return 0;
}