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
Phantasy [73]
2 years ago
12

What set of code correctly initializes all elements of the array ar to the value 0, given the declaration

Computers and Technology
1 answer:
Veronika [31]2 years ago
7 0

Answer:

The correct answer is:

C. ndx = 0;

while (ndx < 3) {

ar[ndx] = 0;

ndx++;

}

Explanation:

The declaration given is:

int ar[3];

This means the array consists of three locations and is named as ar.

We know that the indexes are used to address the locations of an array and the index starts from 0 and goes upto to 1 less than the size of the array which means the indexes of array of 3 elements will start from 0 and end at 2.

Now in the given options we are using ndx variable to run the while loop.

So the code to assign zero to all elements of array will be

ndx = 0;

while(ndx<3)

{

ar[ndx] = 0;

ndx++;

}

Hence, the correct answer is:

C. ndx = 0;

while (ndx < 3) {

ar[ndx] = 0;

ndx++;

}

You might be interested in
Which feature should be used prior to finalizing a presentation to ensure that audience members with disabilities will be able t
grin007 [14]

Answer:

Accessibility Checker

8 0
3 years ago
Read 2 more answers
Syntax refers to what aspect of language? sounds of words order of words meanings of words
olya-2409 [2.1K]

The answer is order of words.


4 0
3 years ago
A process-based DO/S must synchronize actions across the network. When a process reaches a point at which it needs service from
Molodets [167]

Answer:

WAIT

Explanation:

Based on the information provided within the question it can be said that the processor server puts the process in a WAIT state. In other words it temporarily pauses the server from taking any action until the message from the service request comes back with a response. Once that happens it receives new instructions and is resumed.

8 0
3 years ago
Why is flash memory considered nonvolatile?
IgorLugansk [536]

Answer:

flash memory is considered non-volitile becuase it does not require power to hold data. thats why its usually used to store the BIOS on a motherboard, which is unlike volitile memory that needs to be powered (like RAM).

8 0
3 years ago
Earned value:<br><br> How is it calculated?<br><br><br> What does the measurement tell you?
viva [34]

Answer:

Earned value is a measure which is used on projects to determine the value of work which has been completed to date, in order to understand how the project is performing on a cost and schedule basis. At the beginning of a project, a project manager or company will determine their budget at completion (BAC) or planned value (PV).

Explanation:

7 0
3 years ago
Other questions:
  • Which two computer peripherals are connected to the computer through a port?
    9·1 answer
  • Which of the following statements best
    9·1 answer
  • The best time to visit a college is: A. during spring break. B. on a weekend. C. when the college is in session. D. during winte
    8·2 answers
  • 12. When trying to identify the sorted column in a table, you would look for the column where A. an arrow is displayed in the fi
    10·2 answers
  • List the seven basic internal components found in a computer tower
    12·2 answers
  • FREE BRAINLIEST!!!
    14·2 answers
  • Classroom content transaction <br> examples use of IT
    8·1 answer
  • Hannah wants to write a book about how scientists and society interact, and she has generated ideas for chapters. Which chapter
    13·1 answer
  • Multimedia computer system required the following hardware component they are what​
    8·1 answer
  • Aurelia is designing a user interface for a new game app. Which of the following should she taken into consideration for the use
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!