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

According to the northwest ordinance, when could a territory ask to become a state?
Why the Nazi-Soviet Non-Aggression Pact was such a surprise to the world.
HELP please!! 10 point question Write 2 short paragraphs describing famous people from the Spanish speaking world. Make sure to include their cultural or polit
perimeter of a rhombus is 146cm and the length of one of its diagonal is 48cm.find the length of its other diagonal.
In July 1836, Andrew Jackson issued the Specie Circular, which required that public lands be purchased using
The Japanese-Americans were completely prevented from fighting in WWII. A.trueB.false
During World War II, the United States government set up hundreds of internment camps to house
Two fafactors of 20 add up to 9 what are they?
What number is 10 more than 64
I have lungs but no legs. My offspring are found in membranous-shelled eggs and use lungs to breathe.