Write a function copy that takes two arrays A and B, both of size N. The function then copies all N values from A into B and then displays it.

Answers

Answer 1
Answer:

Answer:

Written in C++

#include<iostream>

using namespace std;

int main()

{

int N;

cout<<"Length of Array: ";

cin>>N;

int A[N], B[N];

for(int i =0;i<N;i++)  {

 cin>>A[i];

}

for(int i =0;i<N;i++)  {

 B[i] = A[i];

}

for(int i =0;i<N;i++)  {

 cout<<B[i]<<" ";

}  

return 0;

}

Explanation:

This line declares the length of the Array; N

int N;

This line prompts user for length of array

cout<<"Length of Array: ";

This line gets user input for length of array

cin>>N;

This line declares array A and B

int A[N], B[N];

The following iteration gets input for Array A

for(int i =0;i<N;i++)  {

 cin>>A[i];

}

The following iteration gets copies element of Array A to Array B

for(int i =0;i<N;i++)  {

 B[i] = A[i];

}

The following iteration prints elements of Array B

for(int i =0;i<N;i++)  {

 cout<<B[i]<<" ";

}  


Related Questions

One advantage of the Second generation of programming language is that it is machine dependent. True or False
Assume that two computers are directly connected by a very short link with a bandwidth of 125 Mbps. One computer sends a packet of 1000 Bytes to the other computer. What’s the end-to-end delay (ignoring the propagation delay)?
Consider the operation of a machine with the data path given below. Suppose that loading the ALU input registers takes 5 nsec, running the ALU takes 10 nsec, and storing the result back in the register scratchpad takes 5 nsec. What’s the maximum number of MIPS this machine is capable of with pipelining with the three execution stages?
Laptop components that can be replaced relatively easily include the ____ and the ____first partscreen power supplyRAM second part hard diskkeyboard touchpad​
Which is an example of an operating systemaAdobe PhotoshopbInternet ExplorercWindowsdMicrosoft Word

A(n) _____ is a harmful program that resides in the active memory of the computer and duplicates itself.Worm
Virus
Keylogger
Timebomb

Answers

Answer: Worm

Explanation: Worm is the malicious software program which acts as the infection in the computer system. It has the ability to replicate itself and spread in the other systems .It is found in those parts that have automatic operation and non-noticeable.

The effect of the worm is slowing down the operations ,disturb the network etc.Other options are incorrect because virus is the malicious program that infects the host, key-loggers are used for monitoring of system and  time bomb is the program for releasing the virus in computer network. Thus, the correct option is worm.

g Write a line of code to invoke a function named RandNum, which accepts no parameters, and storing the return value in a variable called num (which has already been defined). Separate each item with 1 space (except around the parentheses), and end the line with a semi-colon.

Answers

Answer:

public int RandNum();

* Assuming it returns an integer

Explanation:

I believe you mean to write the function header of randNum.

To write the header of the function, we need to specify its return type, name, parenthesis and parameters inside the parenthesis - if exist.

If it returns an integer it should have int, if it returns a double it should have double in the header. In the answer, I assumed it returns an integer.

The name is already given, RandNum

Since, the function does not take any parameter, inside of the parenthesis will be empty.

In this project you will write a set of instructions (algorithm). The two grids below have colored boxes in different locations. You will create instructions to move the colored boxes in grid one to their final location in grid two. Use the
example to help you. The algorithm that you will write should be in everyday language
(no pseudocode or programming language). Write your instructions at the bottom of the
page.
Example: 1. Move
the orange box 2
spaces to the right.
2. Move the green
box one space
down. 3. Move the
green box two
spaces to the left.
Write your instructions. Review the rubric to check your final work.
Rules: All 6 colors (red, green, yellow, pink, blue, purple) must be move to their new location on the grid. Block spaces are
barriers. You cannot move through them or on them – you must move around them

Answers

Answer:

Explanation:

Pink: Down 5 then left 2.

Yellow: Left 3 and down 2.

Green: Right 7, down 4 and left 1.

Purple: Up 6 and left 9.

Red: Left 7, down 5 and left 1.

You can do the last one, blue :)

Answer:

Explanation:

u=up, d=down, r=right, l=left

yellow: l3d2

pink: d5l2

green: r7d4l1

purple: u6l9

red: l7d5l1

blue: r2u7l5

Direct current is produced by an electric motor. an armature. a solenoid. a battery.

Answers

Answer:

D

Explanation:

I just did it

I believe D or A would be the answer. D for sure is correct

How can you represent a graphic element in a wireframe?You can specify a graphic element by using an)

Answers

Answer:

The answer is "in the form of design, color and graphic".

Explanation:

The wireframe is also recognized as 'skeleton', it is a static, low-fidelity description of various layouts, which provides shapes to the component. It is indeed a visualization of even an interface using only basic shapes.

It is a 2D illustration of a site user interface, which primarily focuses on capacity planning and priority of information, features available, and role expectations like, storyboards which do usually not include design, color, or graphics.

Answer:

box

Explanation:

i just took the quiz and that's the correct answer they're looking for :)

Which of the following terms is used to describe a program that copies itself repeatedly, using up resources and possibly shutting down the computer or network?(A) A virus
(B) A warm
(C) A trojan horse
(D) A rootkit

Answers

Answer: Option (B) is correct.

Explanation:

A worm in technical sense is also known as a computer worm which is a self-replicating virus/ malicious content that replicates itself in order to spread to the uninfected PC. They often use components of an OS (operating system) which are automatic and also invisible to an individual. It should be duly noted that it is usual for a computer worm to be observed only when their replication utilizes system content, slowing other tasks at hand.