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]
3 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]3 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
645656565656564548778465132131321231
irga5000 [103]
I don’t get this but you just put random number
6 0
3 years ago
How to use a state value in stylesheet in react native.
lana66690 [7]

Answer:

Change this code:

return <View style={[styles.container, backgroundColor: this.state.bg]}/>

for this code:

return <View style={[styles.container, {backgroundColor: this.state.bg}]}/>

3 0
2 years ago
What kind of Encryption is this:
VMariaS [17]

The Encryption of a website

4 0
3 years ago
The strength of gravity on the Moon is 1.6
sergeinik [125]

Answer:

Mass = 80kg

Explanation:

Given

On Earth

Mass = 80kg

On the moon

g = 1.6N/kg

Required

The astronaut's mass on the moon

The mass of an object do not change base on location

So, if the mass of the astronaut is 80kg on earth, it will be 80 kg on the moon.

Hence:

Mass = 80kg

6 0
3 years ago
Which motherboard slot should you install a new high-end graphics card in?
hram777 [196]

Answer:

The latest PCIe ×16 primary slot top near to CPU should be the answer to this question.

6 0
3 years ago
Other questions:
  • import java.util.ArrayList; // Needed for ArrayList class /** This program demonstrates how to store BankAccount objects in an A
    5·1 answer
  • A. True <br> b. False: variables represent storage locations in the computer's memory.
    13·1 answer
  • The most widely used presentation software program is Microsoft PowerPoint. You can produce a professional and memorable present
    14·1 answer
  • What is Mainframe computer​
    15·1 answer
  • Discuss trends in cellular data transmission speeds
    15·2 answers
  • Write an assembly program that will prompt the user for 3 inputs (let’s abstractly call them a, b, and c) without a leading stri
    13·1 answer
  • What X coordinate does the center of a game begin at?
    9·1 answer
  • Can anyone fill in the space please
    6·1 answer
  • You are having a problem with your Windows computer that is isolated to a single graphics editing program that you use every day
    12·1 answer
  • Which memory can be removed from motherboard? RAM OR ROM?​
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!