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

find the domain and range and type the correct code?
Gwen has loyalty card for a store that gives her a discount of 5% off the marked price of items. Office Chair $800, Acer Laptop $4580. (a) How much will she pay
TR = 3x + 5, and RA = x + 17. Find the value of x.
Each year a certain amount of money is deposited in an account which pays an annual interest rate of r so that at the end of each year the balance in the accoun
Which of the following values are solutions to the given equation? |x + 2| = 5 Be sure to select ALL numbers which are solutions. (Select all that apply.) x = -
What is the following difference? 2ab(√/182ab²-5(√81a¹65) -3ab33ab² 16ab² (2√3a)-45a²b²(2√/3b) -7ab(2√/3ab²) 8ab33ab²-15ab² (√3ab)
Could someone tell what element your specific atom is based on your model? Explain.
can anyone help me solve this (-5z)³
What are the values of (-2)^4 and -2^4? 8 and -8 16 and 16 -8 and -8 16 and -16
A plumber has a 20Foot