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 of these is an example of an input?
boyakko [2]

Answer:

typing on a key board

this is the best Ans.

8 0
2 years ago
When creating a mail merge, you must insert all of the items from your data source into your merged document. Truth or false ?
ElenaW [278]
True <----------------
3 0
3 years ago
Read 2 more answers
By the 1970s, the acceleration of airplane travel led to fears that an epidemic would leapfrog the globe much faster than the pa
kramer

Answer:

b. the HIV infection.

Explanation:

Around the 1970s, an increase in the use of airplane travel led to fears that an epidemic would leapfrog the globe much faster than the pandemics such as tuberculosis, leprosy, smallpox, trachoma, anthrax, scabies, etc., that were evident during the Middle Ages, fears that were later confirmed by the worldwide spread of the HIV infection, beginning in the 1970s in the United States of America.

STD is an acronym for sexually transmitted disease and it can be defined as diseases that are easily transmissible or contractable from another person through sexual intercourse. Thus, STD spread from an infected person to an uninfected person while engaging in unprotected sexual intercourse. Some examples of STDs are gonorrhea, chlamydia, syphilis, HIV, etc.

HIV is an acronym for human immunodeficiency virus and it refers to a type of disease that destabilizes or destroy the immune system of a person, thus, making it impossible for antigens to effectively fight pathogens.

Generally, contracting STDs has a detrimental effect to a patient because it causes an opening (break) or sore in the body of the carrier (patient) and as such making them vulnerable to diseases that are spread through bodily fluids e.g human immunodeficiency virus (HIV), Hepatitis, staphylococcus, AIDS, etc.

4 0
2 years ago
What kind of network is built around the concept of low-power transmitters built on towers that can use the same radio frequency
marishachu [46]

Answer:

Cellular telephone network

Explanation:

Cellular telephone network utilizes the concept of the such towers that allows the use of transmitters of low power and make use of the same channel for the radio frequency.

Cellular network is the network for communication in which the end link of the network is wireless. This type type of network is distributed and makes use of the radio waves over the land areas of the network referred to as the 'cells'. These cells are served individually by the fixed base station that enables the transmission of calls over a wide range through wireless links to a fixed receiver

4 0
3 years ago
Jude is a part of a publishing house. He does editing work for them and often comes across articles that have materials copied f
Butoxors [25]

Answer: The guy in the story did copyright

Explanation:

I am not to sure about this but this is my best guess hope it helps!!

5 0
2 years ago
Other questions:
  • A binary search can be performed only on ____.
    6·1 answer
  • What are the different components of the cloud architecture?
    5·2 answers
  • In gaming, "rendering" refers to:
    12·2 answers
  • Which of these browsers was the first widely adopted?
    12·1 answer
  • Choose all of the items that represent functions of the operating system kernel.
    15·2 answers
  • An expression which combines variables numbers and at least one operation
    8·1 answer
  • Jason is working on a Microsoft Excel worksheet and he wants to create a Print Preview shortcut. His teacher asks him to access
    9·1 answer
  • -) An attribute is a(n)?
    5·1 answer
  • When you check your hard drive to see how much space is available, you are checking your
    15·1 answer
  • Which directory contains the initrd file? in suse linux
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!