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

How do you compare the cotton textile industry of Ahmedabad with Osaka. pls ans fast, ill mark u brianliest if u do.
What is the difference between the solution of a linear equation and the solution to a linear inequality?
Anyone can help me answer this question
where ___ you often __ (sit) ?​
A box has dimensions 0.2 mx 0.4 m x 0.6 m. What is the volume of the box in cubic meters? Round to the nearest hundredths.
Someone please help me i really need help
Please solve I need it quick
The length of a side of a square is (2x - 1) cm. 1. What is the perimeter of the square? 2. What is the area of the square? 3. Is it possible that x is 0.25? Ju
How are Congress’s implied powers different from its expressed powers? make it short
The three types of fitness as discussed are: running, sports, and gymnastics. Question 3 options: True False