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]
3 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]3 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
A key or combination of keys that complete an action more efficiently than using the mouse is called a(n) keyboard shortcut.
andreev551 [17]
The answer to your question is true
6 0
3 years ago
The __________ was the first all electronic computer.
spayn [35]

Answer:

its the ENIAC

4 0
3 years ago
System analysis and design
Oksana_A [137]

Answer:

teachers go hard on you dont they

Explanation:

5 0
4 years ago
What are the steps of active listening?
SashulF [63]
1 prepare mentally
2 pay attention
3 allow the speaker to talk without interruption until he is done
4 provide feedback
5 repeat the feedback until you and the communicator are satisfied that the message was conveyed well
7 0
3 years ago
Which of the following best explains how algorithms that run on a computer can be used to solve problems?
timama [110]

The statement which best explains how algorithms running on a computer can be used to solve problems is; D. Some problems cannot be solved by an algorithm.

<h3>What is an algorithm?</h3>

An algorithm is simply a standard formula or procedures which is made up of a set of finite steps and instructions that must be executed on a computer, so as to proffer solutions to a problem or solve a problem under appropriate conditions.

However, it should be noted that it is not all problems that can be solved by an algorithm, especially because the required parameters and appropriate conditions are not feasible or met.

Read more on algorithm here: brainly.com/question/24793921

7 0
2 years ago
Other questions:
  • Which of the following statements about certificates is true?
    14·2 answers
  • Which of the following is Microsoft’s fastest, most efficient operating system to date: a. Offering quicker application start up
    14·1 answer
  • Which sequence of slides would be followed in a linear slideshow? A. slide 4 -&gt; slide 5 -&gt; slide 6 -&gt; slide 7 B. slide
    8·2 answers
  • How do the steps taken by leaders of Athens reflect a turn towrd democracy
    10·1 answer
  • Write a new version (called map2) of the map function which operates on two lists. Your function should accept three parameters,
    15·1 answer
  • there are these numbers that I've seen before but I don't know what they mean can someone help. I will give brainiest
    8·2 answers
  • Can you see the processing step yes or no
    8·2 answers
  • Martha pays $3,335 every month for her house payment. She has made 86 payments up till now. How much has Martha paid for her hou
    15·1 answer
  • Why is computer economics important?​
    10·1 answer
  • The format that you will use on your works cited page when the entry is longer than one line is__________.
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!