134k views
0 votes
To assign the contents of one array to another, you must use ________.

a. the assignment operator with the array names
b. the equality operator with the array names
c. a loop to assign the elements of one array to the other array
d. Any of these
e. None of these

1 Answer

1 vote

Answer:

Option c is the correct answer for the above question.

Step-by-step explanation:

  • The array is used to holds multiple variables and the assignment operator can assign only a single variable at a time. So if a user wants to assign the whole array value into other array value then he needs to follow the loop.
  • The loop iteration moves on equal to the size of the array. It is because the array value moves into another array in one by one. It means the single value can move in a single time. So the moving processor from one array to another array takes n times if the first array size is n.
  • The above question asked about the processor to move the element from one array to another and the processor is a loop because the loop can execute a single statement into n times. So the C option is correct while the other is not because--
  1. Option 'a' states about one assignment operator which is used for the one value only.
  2. Option b states about the equality operator which is used to compare two values at a time.
  3. Option d states any of these but only option c is the correct answer.
  4. Option 'e' states none of these but option c is the correct.
User Margi
by
5.2k points