•✿♥lostlove♥✿•
New member
برنامه زير دو ماتريس 5*5 را از ورودي ميگيره و حاصل جمع را در خروجي نمايش ميده
#include <cstdlib>
#include <iostream>
using namespace std;
int main()
{
int x[5][5],y[5][5],z[5][5],i,j;
cout<<"\n Matris 1";
for(i=0;i<5;i++)
for(j=0;j<5;j++){
cout<<"\n Enter a number satre "<<i+1 <<" sotone "<<j+1 <<" : ";
cin>>x[j];
}
cout<<"\n Matris 2";
for(i=0;i<5;i++)
for(j=0;j<5;j++){
cout<<"\n Enter a number satre "<<i+1 <<" sotone"<<j+1 <<" : ";
cin>>y[j];
}
for(i=0;i<5;i++)
for(j=0;j<5;j++)
z[j]=x[j]+y[j];
cout<<"\n\n Value ";
for(i=0;i<5;i++){
cout<<endl;
for(j=0;j<5;j++){
cout<<"\t"<<z[j];
}
}
cout<<"\n";
system("PAUSE");
return EXIT_SUCCESS;
}
#include <cstdlib>
#include <iostream>
using namespace std;
int main()
{
int x[5][5],y[5][5],z[5][5],i,j;
cout<<"\n Matris 1";
for(i=0;i<5;i++)
for(j=0;j<5;j++){
cout<<"\n Enter a number satre "<<i+1 <<" sotone "<<j+1 <<" : ";
cin>>x[j];
}
cout<<"\n Matris 2";
for(i=0;i<5;i++)
for(j=0;j<5;j++){
cout<<"\n Enter a number satre "<<i+1 <<" sotone"<<j+1 <<" : ";
cin>>y[j];
}
for(i=0;i<5;i++)
for(j=0;j<5;j++)
z[j]=x[j]+y[j];
cout<<"\n\n Value ";
for(i=0;i<5;i++){
cout<<endl;
for(j=0;j<5;j++){
cout<<"\t"<<z[j];
}
}
cout<<"\n";
system("PAUSE");
return EXIT_SUCCESS;
}