Just wondering how I can do an input on 2 different buffers (P & Q). Here's what I've got so far.
#include <iostream>
using namespace std;
const int SIZE = 3;
int P[3][3];
int Q[3][3];
int row;
int col;
int main()
{
int P[3][3]
{
cout << "Enter " << SIZE << " rows of " << SIZE << " integers each:\n";
for (row = 0; row < SIZE; row++)
for (col = 0; col < SIZE; col++)
cin >> P[row][col];
cout << "Displaying:\n" ;
for (row = 0; row < SIZE; row++)
{
for (col = 0; col < SIZE; col++)
cout << P[row][col]<< " ";
cout << endl;
}
}
int Q[3][3]
{
cout << "Enter " << SIZE << " rows of " << SIZE << " integers each:\n";
for (row = 0; row < SIZE; row++)
for (col = 0; col < SIZE; col++)
cin >> Q[row][col];
cout << "Displaying:\n" ;
for (row = 0; row < SIZE; row++)
{
for (col = 0; col < SIZE; col++)
cout << Q[row][col]<< " ";
cout << endl;
}
}
return 0;
}
#include <iostream>
using namespace std;
const int SIZE = 3;
int P[3][3];
int Q[3][3];
int row;
int col;
int main()
{
int P[3][3]
{
cout << "Enter " << SIZE << " rows of " << SIZE << " integers each:\n";
for (row = 0; row < SIZE; row++)
for (col = 0; col < SIZE; col++)
cin >> P[row][col];
cout << "Displaying:\n" ;
for (row = 0; row < SIZE; row++)
{
for (col = 0; col < SIZE; col++)
cout << P[row][col]<< " ";
cout << endl;
}
}
int Q[3][3]
{
cout << "Enter " << SIZE << " rows of " << SIZE << " integers each:\n";
for (row = 0; row < SIZE; row++)
for (col = 0; col < SIZE; col++)
cin >> Q[row][col];
cout << "Displaying:\n" ;
for (row = 0; row < SIZE; row++)
{
for (col = 0; col < SIZE; col++)
cout << Q[row][col]<< " ";
cout << endl;
}
}
return 0;
}
Comment