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
lions [1.4K]
2 years ago
12

What will the following code display? int numbers[4] = { 99, 87 }; cout << numbers[3] << endl; a. 87 b.0 d. 34. What

will the following code do? const int SIZE = 5; double x[SIZE]; for(int i = 2; i <= SIZE; i++) { x[i] = 0.0; } garbage This code will not compile a. Each element in the array is initialized to 0.0 b. Each element in the array, except the first, is initialized to 0.0 c. Each element in the array, except the first and the last, is initialized to 0.0 d. An error will occur when the code runs
Computers and Technology
1 answer:
pishuonlain [190]2 years ago
7 0

Answer:

1. The output is 0

2. Each element in the array is initialized to 0.0

Explanation:

Solving (a): The output of the code

We have:

<em>int numbers[4] = { 99, 87 }; </em>

<em>cout << numbers[3] << endl;</em>

<em />

The first line initializes the 0 and 1 index of the array to 99 and 87, respectively.

Other elements will be 0, by default.

So, the following code segment will output 0

<em>cout << numbers[3] << endl; </em>

<em />

Solving (b): What the given code will do?

The first and second line declares an array of 5 elements

However, the following iteration will only initialize the array with 0.0 starting from the second

<em>for(int i = 2; i <= SIZE; i++) { x[i] = 0.0; }</em>

<em />

Because, the counter is initialized to start from the second index.

You might be interested in
1.Microsoft Word is a/an ........​
Finger [1]

Answer:

company I believe

Explanation:

I believe

3 0
2 years ago
Read 2 more answers
How do we prevent electrical problems as prescribe by the course?​
Alex777 [14]

Answer:

Check your electrical cords.

When you are done with an electrical appliance, do not rip the cord out of the wall.

Electrical cords should not be hidden from plain sight.

Do not run electrical cords underneath furniture, rugs or carpets.

Remember that water and electricity do not mix.

(i hope this helps id really know if i answered ur question right)

:)

Explanation:

3 0
3 years ago
When using for loops and two-dimensional arrays, the outside loop moves across the ___________ and the inside loop moves across
lana66690 [7]

Answer: rows, columns

Explanation: :)

6 0
2 years ago
What is the best method to avoid getting spyware on a machine
monitta

Answer: The best method to avoid getting spyware on a user machine is to download software only from trusted websites. And depending on the machine it might say that "This download you are about to install might have spyware or malware and it might infect your laptop" "Do you wish to continue?"

3 0
2 years ago
How to cite a website, like asha.org?
inn [45]
Using the APA style or the<span> American Psychological Association style of referencing or citing sources, the structure for website reference is as follows:
</span>Last, F. M. (Year, Month Date Published). Article title<span>. Retrieved from URL. Hence, for the problem:
</span>Last, F. M. (Year, Month Date Published). Article title<span>. Retrieved from http://www.asha.org</span>
8 0
3 years ago
Other questions:
  • A machine is classified as a compound machine if it?
    8·2 answers
  • Why were mechanical calculators developed?
    8·2 answers
  • Please help! (I cant figure out)
    13·1 answer
  • Multiple Choice
    6·1 answer
  • Write a program with a function that accepts a string as an argument and returns a copy of the string with the first character o
    11·1 answer
  • A queueing system has four crews with three members each. The number of "servers" is:
    5·2 answers
  • Which is NOT a benefit of using visual aids?
    9·2 answers
  • What are the trinity of the computer system
    10·1 answer
  • IN WHICH COUNTRY DO THEY LET YOU PLAY MINECRAFT IN SCHOOL?
    8·2 answers
  • PLEASE HELP WILL GIVE BRAINLIEST!!!’
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!