65 554
Assignments Done
99,3%
Successfully Done
In October 2018

Answer to Question #15148 in C++ for joshuajobin08

Question #15148
i am having a doubt , how to make make matrix in addition but my output should be in this way
1 1 1 1 1 1 2 2 2
1 1 1 + 1 1 1 = 2 2 2
1 1 1 1 1 1 2 2 2
i am able to make single matrix but to make in this way is difficult.
Expert's answer
#include <conio.h>

int main()
{
int a[3][3];
int b[3][3];
int c[3][3];
for(int i=0;i<3;i++){
for(int j=0;j<3;j++){
a[i][j]=1;
b[i][j]=1;
}
}

for(int i=0;i<3;i++){
for(int j=0;j<3;j++){
c[i][j]=a[i][j]+b[i][j];
}
}
for(int i=0;i<3;i++){
for(int j=0;j<3;j++){
printf("%d",a[i][j]);
}
printf("
");
}
printf("+
");
for(int i=0;i<3;i++){
for(int j=0;j<3;j++){
printf("%d",b[i][j]);
}
printf("
");
}
printf("=
");
for(int i=0;i<3;i++){
for(int j=0;j<3;j++){
printf("%d",c[i][j]);
}
printf("
");
}

getch();
return 0;
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be first!

Leave a comment

Ask Your question

Submit
Privacy policy Terms and Conditions