how to remove the input of a matrix, with a declared one with values
#includeusing namespace std;int main(){int n;cout < "enter="" the="" order="" of="" the="" matrix:="">cin >> n;int M[n][n] = {cout < "enter="" the="" elements="" of="" the="" matrix:="">for(int i=0; i{for(int j = 0; jcin >> M[i][j];}cout < "the="" matrix:="">for(int i=0; i{for(int j = 0; jcout < m[i][j]=""><>cout <>}int temp;for(int i=0; i{if((i+1) %2 != 0){for(int j=0; j{for(int k=j+1; k{if(M[i][j] <>{temp = M[i][j];M[i][j] = M[i][k];M[i][k] = temp;}}}}else{for(int j=0; j{for(int k=j+1; k{if(M[i][j] > M[i][k])temp = M[i][j];M[i][j] = M[i][k];M[i][k] = temp;}}}}}cout < "the="" required="" matrix:="">for(int i=0; i{for(int j = 0; jcout < m[i][j]=""><>cout <>}return 0;}
using namespace std;
int main()
{
int n;
cout < "enter="" the="" order="" of="" the="" matrix:="">
cin >> n;
int M[n][n] = {
cout < "enter="" the="" elements="" of="" the="" matrix:="">
for(int i=0; i
for(int j = 0; j
cin >> M[i][j];
}
cout < "the="" matrix:="">
cout < m[i][j]=""><>
cout <>
int temp;
if((i+1) %2 != 0)
for(int j=0; j
for(int k=j+1; k
if(M[i][j] <>
temp = M[i][j];
M[i][j] = M[i][k];
M[i][k] = temp;
else
if(M[i][j] > M[i][k])
cout < "the="" required="" matrix:="">
return 0;
Already registered? Login
Not Account? Sign up
Enter your email address to reset your password
Back to Login? Click here