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
Stella likes to work with colors and moving pictures. She is good at drawing. Which job role should she choose
PilotLPTM [1.2K]

Answer:

Digital Art or Animator for moving picture art.

Explanation:

7 0
3 years ago
Read 2 more answers
Technician A says that the TP sensor signal voltage should be about 0.5 volt at idle and increase to about 2.5 volts at wide-ope
swat32

Answer:

Both are right.

Explanation:

4 0
3 years ago
Dragging or sizing affects only a ____.
il63 [147K]
<span>Dragging or sizing affects only a "Selected Object." For example, an image, you need to click the image in order for you to select that image. The image is considered as an object. From the time you click on the picture, there are points visible where you can click and drag upon it nor resize.</span>
7 0
3 years ago
Advantages of monolithic operating system? ​
Lyrx [107]

Advntage:

provides CPU scheduling, memory management, file management, and other operating system functions through system calls. The other one is that it is a single large process running entirely in a single address space.

Disadvantage: if anyone service fails it leads to an entire system failure

8 0
2 years ago
Help<br> pls need quickly
g100num [7]

Answer:

Themes

Explanation:

  1. In the slide thumbnail pane on the left, select a slide.
  2. On the Design tab, in the Themes group, click the More button (illustrated below) to open the entire gallery of themes:
  3. Point the mouse at the theme you want to apply. Right-click it, and then select Apply to All Slides.
3 0
2 years ago
Other questions:
  • (Game Design) Which of the following is NOT a name of a popular digital sculpting application?
    13·1 answer
  • Yolanda lost her left foot during her military service, but she has been issued a prosthetic that enables her to walk normally,
    13·1 answer
  • So I emailed Brainly to deleted my account. Why haven’t they done so yet? I don’t want to get charged money for this app I was p
    14·1 answer
  • What does a computer need from people in order to solve problems effectively?
    9·1 answer
  • What is the best stratiget to avoid paying intrest in your credit cared
    13·1 answer
  • Write function d2x() that takes as input a nonnegative integer n (in the standard decimal representation) and an integer x betwe
    14·1 answer
  • A motor is controlled by a logic circuit. The circuit has inputs (0 or 1) from three sensors
    8·1 answer
  • What are the words that make up a high-level programming language called?
    6·1 answer
  • Can someone please give me Python test 3 it would help me tremendously
    5·1 answer
  • You’ve been hired to help a bank automate their deposit/withdrawal system! Your task is to write a Python program that interacts
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!