C Program Addition of Two Matrix

Google Advertisements

Prev Tutorial Next Tutorial

Addition of Two Matrix Program in C

To achieve addition of two matrix we need two-dimensional array and add their elements with each other and print result on screen.

program addition of two matrix

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

void main()
{
int x[3][3],y[3][3],z[3][3],i,j;
clrscr();
printf("ENTER ELEMENTS OF 1st MATRIX\n");
for(i=0;i<3;i++)
{
for(j=0;j<3;j++)
scanf("%d",&x[i][j]);
}
printf("ENTER ELEMENTS OF 2nd MATRIX\n");
for(i=0;i<3;i++)
{
for(j=0;j<3;j++)
scanf("%d",&y[i][j]);
}
printf("MATRIX [X]");
for(i=0;i<3;i++)
{
printf("\n\n");
for(j=0;j<3;j++)
printf(" %d",x[i][j]);
}
printf("\nMATRIX [Y]");
for(i=0;i<3;i++)
{
printf("\n\n");
for(j=0;j<3;j++)
printf(" %d",y[i][j]);
}
for(i=0;i<3;i++)
{
for(j=0;j<3;j++)
z[i][j]=x[i][j]+y[i][j];
}
printf("\nMATRIX [Z]");
for(i=0;i<3;i++)
{
printf("\n\n");
for(j=0;j<3;j++)
printf(" %d",z[i][j]);
}
getch();
}

Output

matrix program
Prev Tutorial Next Tutorial

Google Advertisements

Buy This Ad Space @$50 per Month, Ad Size 600X200 Contact on: hitesh.xc@gmail.com or 8076671483

Pure VPN Privide Lowest Price VPN Just @ $1.65. Per Month with Non Detected IP Lowest Price Non Detected IP VPN

Magenet is best Adsense Alternative here we earn $2 for single link, Here we get links ads. Magenet

Cloud computing is the on demand availability of computer system resources, especially data storage and computing power, without direct active management by the user. Cloud Computing Tutorial

College Projects Related to Java, AWT, C Projects for College, C++ Projects for College, Android Projects. Download Java C C++ Projects

Download Projects

Adsense Advertisements


Buy This ads Space 8076671483

Buy This Ad Space @$120 per Month, Ad Size 300X600 Contact on: hitesh.xc@gmail.com or 8076671483 Try this Keyword C++ Programs