Hi i need help on my assignment what i have to do is Enter data into a 5 X 7 array. The example i have is
Please enter the numbers in the first row: 1234567
Please enter the numbers in the second row: 1234567
Please enter the numbers in the third row: 1234567
Please enter the numbers in the fourth row: 1234567
Please enter the numbers in the fifth row: 1234567
The original array is:
1234567
1234567
1234567
1234567
1234567
Average of row one is: 4
Average of row two is: 4
Average of row three is: 4
Average of row four is: 4
Average of row five is: 4
Average of column one is: 1
Average of column two is: 2
Average of column three is: 3
Average of column four is: 4
Average of column five is: 5
Average of column six is: 6
Average of column seven is: 7
what i got is .. how do I get the original array and averages thank you
#include <iostream>
using namespace::std;
#include <iomanip>
int main()
{
const int size = 5;
const int column = 7;
int a[size];
int num,num1,num2,num3,num4,num5,num6;
cout <<"Please enter seven numbers in the first row: ";
cin >>num>>num1>>num2>>num3>>num4>>num5>>num6;
cout <<"Please enter seven numbers in the second row: ";
cin>>num>>num1>>num2>>num3>>num4>>num5>>num6;
cout <<"Please enter seven numbers in the third row: ";
cin>>num>>num1>>num2>>num3>>num4>>num5>>num6;
cout <<"Please enter seven numbers in the fourth row: ";
cin>>num>>num1>>num2>>num3>>num4>>num5>>num6;
cout <<"Please enter seven numbers in the fifth row: ";
cin>>num>>num1>>num2>>num3>>num4>>num5>>num6;
cout <<"The original array is: \n";
for ( int i = 0; i < size; i++ )
cout <<"\n"<< setw( 3 )<<a[ i ];
return 0;
}