#include <iostream>
#include <conio.h>
usingnamespace std;
int main()
{
int matrix[5][7], add_row[7], i, j, k;
//create the code with random number of rows & columns if you want...
cout<<"Enter elements of the matrix:\n";
for(i=0; i<5; i++){
for(j=0; j<7; j++)
cin>>matrix[i][j];
}
cout<<"\nThe matrix is:\n";
for(i=0; i<5; i++){
for(j=0; j<7; j++)
cout<<matrix[i][j]<<" ";
cout<<endl;
}
cout<<"\n\nEnter elements of the row that you want to add:\n";
for(k=0; k<7; k++)
cin>>add_row[k];
cout<<"\nThe added row is:\n";
for(k=0; k<7; k++)
cout<<add_row[k]<<" ";
cout<<"\n\nMatrix after adding the row is:\n";
for(i=0; i<6; i++){
if(i==5){
for(k=0; k<7; k++)
cout<<add_row[k]<<" ";
}
else{
for(j=0; j<7; j++)
cout<<matrix[i][j]<<" ";
}
cout<<endl;
}
getch();
system ("Pause");
return 0;
}