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
How many terabytes is a 128 gigabyte SD memory card
Maksim231197 [3]

Answer:

this would be .128 terabytes

Explanation:

This would be since for a whole terabyte you need 1000 gigabytes every 1000 gigabytes is a terabyte for example let’s say you have 5250 gigabytes you would have 5.250 terabytes that simple hope this helped!

4 0
2 years ago
Read 2 more answers
An example of a(n) ____ reconnaissance attack is a user who sends SQL injections to a system in hopes of generating some type of
Elden [556K]
The answer to this question is A
7 0
3 years ago
Read 2 more answers
Scott does not use privacy settings on his social media
likoan [24]

Answer:

ARREST HIM!!!

Explanation:

7 0
3 years ago
Read 2 more answers
What is land? Explain its features​
egoroff_w [7]

Answer:

Odd question but okay....

Explanation:

Earth's surface, also known as "Land", has very many biotic(animals) and abiotic factors (plants). There are also a wide variety of land features such as mountain, plains, Hills, etc..

Within these features are small - Large ecosystems we're plants and animals thrive to create a bigger and stronger wildlife.

"Land" is a very simple word that stands for all of the different plants, mammals, ecosystems, aquatic animals and many more ways of life on Land.

I hope this helps...

3 0
2 years ago
How is a microprocessor different from an integrated circuit?
pychu [463]

Answer:

Explanation:

Microprocessors are faster, smaller and less expensive than integrated circuits. ... Microprocessors control the flow of electrons and integrated circuits control the flow of protons.

6 0
2 years ago
Other questions:
  • Wich of these is an example of magnetic storage
    11·1 answer
  • A storyboard is an example of an implementation tool.<br><br> A.<br> True<br><br> B.<br> False
    8·2 answers
  • Which factor did not contribute to the increase of leisure travel in the early twentieth century in the United States?
    7·2 answers
  • How can you exaggerate the height of a jump in a photograph
    10·1 answer
  • Which statement describes one drive?
    6·1 answer
  • Before creating a brief to design a product, what is needed
    8·1 answer
  • Write a program that first reads in the name of an input file and then reads the input file using the file.readlines() method. T
    7·1 answer
  • ....is an act of introducing an invention into market on business basis for profit​
    12·1 answer
  • What report provides data on how specific sections of a website performed?
    6·1 answer
  • One way to protect against a security threat to a computer system is to __________. Avoid external links with inconsistent URLs
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!