This C++ program defines two 2D arrays, x and y, where x contains sample data and y is empty. A nested for loop iterates through x, multiplying each element by 2 and storing the result in the corresponding element of y. Each new element of y is then outputted to the console.
This C++ program defines two 2D arrays, x and y, where x contains sample data and y is empty. A nested for loop iterates through x, multiplying each element by 2 and storing the result in the corresponding element of y. Each new element of y is then outputted to the console.
This C++ program defines two 2D arrays, x and y, where x contains sample data and y is empty. A nested for loop iterates through x, multiplying each element by 2 and storing the result in the corresponding element of y. Each new element of y is then outputted to the console.
h> void main () { int x[2][3]={{2,3,1},{3,5,2}}; int y[2][3]; int i,n; for(i=0;i<=1;i++) { for(n=0;n<=2;n++) { y[i][n]=x[i][n]*2; cout<<y[i][n]<<"\t"; } } }