السلام عليكم و رحمة الله و بركاته
شكرا لجهودكم و أتمنى مساعدتي في هذا البرنامج "
Write a program to enter two, 2-D Arrays of size (3 by 2), and print them in the matrix format. Add these 2D arrays and print the sum as third 2D array.
بحثت ووجدت كود بهذه الصيغة :
#include<iostream>
#include<conio.h>
using std::cout;
using std::cin;
using std::endl;
int main()
{
int a[3][2];
int b[3][2];
int c[3][2];
cout<<"\nenter elements of matrix a = "<<endl;
for(int i=0;i<3;i++)
for(int j=0;j<2;j++)
{
cout<<"a["<<i<<"]["<<j<<"]=";
cin>>a[j];
}
cout<<"\Enter element of matrix b ="<<endl;
for(int i=0;i<3;i++)
for(int j=0;j<2;j++)
{
cout<<"b["<<i<<"]["<<j<<"]=";
cin>>b[j];
}
cout<<"\nThe result is:\n";
for(int i=0;i<3;i++)
for(int j=0;j<2;j++)
{
c[j]=a[j]+b[j];
cout<<"c["<<i<<"]["<<j<<"]="<<c[j]<<endl;
}
getch();
return 0;
}لكن المخرجات لاتظهر على شكل مصفوفة !
و لايحدد 6 أرقام ليدخلها المستخدم !
من لديه الخبرة فليساعدني و له الأجر
و شكرا لكم