1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
frosja888 [35]
3 years ago
6

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

.
Computers and Technology
1 answer:
Reika [66]3 years ago
5 0

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:

You might be interested in
Why do we allow electronic instruments to warm up before use?
son4ous [18]
Is not really a warm up!

we wait for the computer (electronic instrument) to load or process all the data in order to operate properly as its supposed to!
3 0
3 years ago
In best practice, should you use all lowercase, all uppercase or a mixture of cases in HTML tag names?
mixas84 [53]
B considering it’s proper english, we went through this about a week ago
7 0
2 years ago
Source documents are
Bas_tet [7]

Answer:

This is the location where a document or a portion of another document was retrieved. reference: computerhope.com

3 0
3 years ago
Need help!! Write an interactive program that reads lines of input from the user and converts each line into "Pig Latin." Pig La
zepelin [54]

<span>user input a elit Interactive legentium lineae ad lineam convertit et "Sus
</span>
6 0
3 years ago
Write a program TwoSmallest.java that takes a set of double command-line arguments and prints the smallest and second-smallest n
aliina [53]

Answer:

The following code is written in java programming language:

public class TwoSmallest {   //define class

   public static void main(String[] args) {     // define main function

       if (args.length < 2) {     //set the if condition

           System.out.println("Enter double values as command line arguments");

       } else {

           double minimum1 = Double.parseDouble(args[0]), minimum2 = Double.parseDouble(args[1]), n;

           if (minimum1 > minimum2) {    //set the if condition

               double temp = minimum1;

               minimum1 = minimum2;

               minimum2 = temp;

           }

           for (int i = 2; i < args.length; i++) {      //set the for loop

               n = Double.parseDouble(args[i]);

               if (n < minimum1) {

                   minimum2 = minimum1;

                   minimum1 = n;

               } else if (n < minimum2) {

                   minimum2 = n;

               }

           }

           System.out.println(minimum1);

           System.out.println(minimum2);

       }

   }

}

Explanation:

Here, we define a class "TwoSmallest" with public modifier.

Then, we define the main method.

Then, we set if condition and pass condition "args.length < 2".

Then we take three double type variable "minimum1", "minimum2" and "n".

Then, we set the if condition and pass condition if "minimum1 > minimum2", then set double type "temp" variable and swap between temp, minimum1 and minimum2.

Then, we set the for loop which is start from 2 and stops at "args.length"

Then, we set if condition and then we set its else part, after that we print the value of minimum1 and minimum2.

7 0
4 years ago
Other questions:
  • Why do you feel an organization has multiple layers of security in place to protect its operation?
    5·1 answer
  • The voluntary linkage of computer networks around the world is called the ______.
    7·1 answer
  • Consider the following methods:
    10·1 answer
  • A film camera with only one lens is known as a(n)?
    11·1 answer
  • Howie is a business analyst who is given access to the database of a product prior to its launch. He needs to understand the dat
    9·1 answer
  • And, Or, Not are examples of:
    11·1 answer
  • 20 POINTS AND BRAINLIEST TO CORRECT ANSWER
    15·2 answers
  • True or false = the order of cannot be changed in slide shorter view ,true or false =menu bar is located just below the title ba
    8·2 answers
  • I can talk to you! How about we talk through the you know where people comment and say stuff about the question1
    10·2 answers
  • The amount of memory used by an array depends upon the array's data type and the number of elements in the array. True False
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!