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
To maintain your body temperature, your body converts chemical potential energy into thermal energy T or F
PilotLPTM [1.2K]
True
This is physics btw
CPE --> TE
4 0
3 years ago
One reason to buy a home instead of rent a home is:
vazorg [7]
A is the correct Answer

7 0
4 years ago
Your mothers date of birth and a unique personal identification number (pin) code provide authentication by _____.
Semenov [28]
Hello <span>Madysonhenders2477 </span><span>

Answer: Your mothers date of birth and a unique personal identification number (pin) code provide authentication by What you are (C)

Since your identification is about who you are, this would be the answer.

Hope This Helps!
-Chris</span>
6 0
3 years ago
The random module is a group of functions that are used to deal with random numbers.
maksim [4K]
True because it is the
5 0
3 years ago
Read 2 more answers
How to scan documents from printer to computer?
Romashka-Z-Leto [24]
The printer should have a control panel. Then you gotta touch Computer to scan to the computer that is connected. Then, touch the name of the computer that you would like to save the scan to. Lastly, touch<span> the scan-to type that corresponds to the document or photo you are scanning.

(By the way, anytime I said 'touch' it meant touch on control panel I believe)

Hope O helped and I apologize if it did not because I own a Mac with no printer. :)</span>
3 0
3 years ago
Other questions:
  • Freya realizes she does not have enough in her bank account to use the debit card. She decides to use a credit card instead. Whi
    7·2 answers
  • The SETI (Search for Extraterrestrial Intelligence) project collected vast amounts of data that needed processing. SETI was one
    14·1 answer
  • Which of the following is a characteristic of the internet today? distributed network central hub lack of protocols absence of c
    5·1 answer
  • which telecommunications service allows internet and telephone service to work over the same phone line
    13·1 answer
  • Write a function called simulate_several_key_strikes. It should take one argument: an integer specifying the number of key strik
    7·1 answer
  • I WILL GIVE BRAINLIEST TO WHO ANSWERS FIRST AND CORRECTLY.
    12·1 answer
  • 1.which screen appears after the password is typed (welcome, lock)​
    11·2 answers
  • Write a program that calculates the average of N integers. The program should prompt the
    12·1 answer
  • Jim is working on a network design for a small office running a Windows file and printer server with Internet
    15·1 answer
  • What Does The Computer Monitor Contain?
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!