2*2 matrices
Title
Question
#include<iostream>
using namespace std;
int main()
{
int a[2][2],b[2][2];
int i,j;
int c[2][2];
cout<<"enter the 2*2 matrices";
cin>>i>>j;
for(i=0;i<=2;i++){
for(j=0;j<=2;j++)
{
cin>>a[i][j];
}
for(i=0;i<=2;i++){
for(j=0;j<=2;j++)
{
cin>>b[i][j];
}
for(i=0;i<=2;i++){
for(j=0;j<=2;j++)
{
c[i][j]=a[i][j]+b[i][j];
cout<<c[i][j]<<"";
cout<<"\t";
}
return 0;
}}}}
Advanced-Cpp General
Answers:
2
Login to add comment