Isaac7573 Isaac7573
  • 17-01-2020
  • Computers and Technology
contestada

Given two 3x3 arrays of integer, x1 and x2, write the code needed to copy every value from x1 to its corresponding element in x2.

Respuesta :

femotinga femotinga
  • 19-01-2020

Answer:

#include<iostream>

#include<iomanip>

using namespacestd;

int main ()

{

int x1[3][3]={1,2,3,4,5,6,7,8,9};

int x2[3][3];

int i,j;

for(i=0;i<3;i++)

for(j=0;j<3;j++)

x2[i][j] = x1[i][j];

cout<<"copy from x1 to x2 , x2 is :";

for(i=0;i<3;i++)

for(j=0;j<3;j++)

cout<<x2[i][j]<<" ";

cout<<endl;

system("pause");

return 0;

}

/* Sample output

copy from x1 to x2 , x2 is :1 2 3 4 5 6 7 8 9

Press any key to continue . . .

*/

Explanation:

Answer Link

Otras preguntas

What is the standard form equation of the line shown below? A.x + 3y=14 B.5x + 3y=14 C.y=-1/3x+14/3 D.y-4 =1/3(x - 2)
where dose this go on the number line
How did Japan solve its shortage of natural resources?
Why are worldwide CO2 emissions still rising?
Someone help please
What is the surface area and volume of this triangular prism?
What is the significance of the gendering of the audience of rock and roll
At LaGuardia Airport for a certain nightly flight, the probability that it will rain is 0.07 and the probability that the flight will be delayed is o.15. The pr
8,382 ÷ 7 divides enter you're answering by filling in these boxes
Find the perimeter of the figure. Round your answer to the nearest tenth.