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
There are 10 girls and 8 boys at a party. A cartoonist want to sketch a picture of each boy with each girl. How many sketches ar
kykrilka [37]
80 sketches will be required. It’s just multiplication. Let x=boys and y=girls. If x=8 and y=10, then one boy has to be with one girl. In total 1 boy will be with 10 girls, so that’s 10 sketches. You do the same for boy #2 and so on. It adds up to 80.
3 0
3 years ago
True / False<br> Generally, more orthogonal instruction sets are considered less elegant.
Cerrena [4.2K]

Answer: True

Explanation:Orthogonal instruction set is the set of instruction that can use can use all addressing mode. They have independent working and so instruction can use any register the prefer and this leads to overlapping in instruction and complexity.

When RISC architecture got introduced ,it got more preference due to reduced instruction and less complexity as compared to orthogonal instruction.So it not considered elegant to have more orthogonal instruction.

6 0
3 years ago
Is an electronic scavenger hunt played around the world.
pogonyaev
It can be played around the world
4 0
4 years ago
Help please I would really appreciate <br>​
Dafna1 [17]

Answer:

the answer is address bar

3 0
3 years ago
Read 2 more answers
Spam is _____.
AfilCa [17]
Multiple answers. Attachment and practice of sending unwanted messages
6 0
3 years ago
Read 2 more answers
Other questions:
  • Which of these can be considered data?
    14·2 answers
  • Suppose you want to delete an existing file from within word. What would you do?
    8·1 answer
  • Write a program that generates a random number and asks the user to guess what the number is. If the user's guess is higher than
    6·1 answer
  • _____ is a method of access control that prevents unauthorized users from using an unattended computer to access the network and
    6·1 answer
  • Describe any four rights of users of information systems.
    8·1 answer
  • What do reservations do?
    15·1 answer
  • Why is operating system pivotal in teaching and learning
    11·1 answer
  • The kings and queens of England are listed in a relation Kings(name,nickname,house,beginReign,endReign). Their name is unique, e
    8·1 answer
  • Which function works best when you need to remove an element at a specific index in a list?
    5·2 answers
  • Evaluating sorts given the following array: 41, 32, 5, 8, 7, 50, 11 show what the array looks like after the first swap of a bub
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!