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
What is the transfer rate of DDR memory?
hoa [83]

DDR memory is 64-bit so that means that it is 64

5 0
3 years ago
PLEASE HELP ME HELP ME NO IM NOT OKAY AND ITS NOT EASY FOR ME.....Vladimir is reworking an old slideshow. He needs to delete som
Mandarinka [93]

Answer:

Outline view

Explanation:

This is a formatted window that shows all text, headers, and titles in a popup on the left side of the screen. Slide master shows all the slides but includes slide details such as inserted images and smart art.

7 0
3 years ago
Write an algorithm to settle the following question:
Vesnalui [34]

Answer:

<u>algorithm</u>

original = float(raw_input("Enter initial balance: "))

interest = float(raw_input("Enter promised return: "))

expenses = float(raw_input("Enter monthly expenses: "))

interest = interest / 100 / 12

month = 0

balance = original

if balance * interest - expenses >= 0:

print "You don't need to worry."

else:

while balance + balance * interest - expenses >= 0: # negation of the if condition

balance = balance + interest * balance # in one month

balance = balance - expenses

month = month + 1

print month, balance

print month / 12, "years and", month % 12, "months"

6 0
3 years ago
A ________ editor was the dominant way film was edited up until the early '90s.
lord [1]
Flatbeds were prominently used up until the mid 90's and were replaced by non-linear software.

4 0
3 years ago
Read 2 more answers
Why do people post about family problems?
kvv77 [185]

Answer:

Some people go through things either traumatizing or painful to them emotionally/mentally past or future. They seek comfort or a feeling thatll make them feel safe for a moment and have comfort from the fear of what may be outside there door wherther its abuse mentally or physically.

4 0
3 years ago
Other questions:
  • Maria's manager asked her to print a certain document for their meeting. It took her so long to find the file that she was late
    6·2 answers
  • Elizabeth types in the following search terms: "Adoption AND cats AND NOT Persians." what results will her search provide?
    12·2 answers
  • What is the single most important component of a computer? Central Processing Unit DIP Motherboard Chipset
    8·1 answer
  • Why is data processing done in computer
    10·1 answer
  • Petra has an interview with an IT company. What technique can help prepare her?
    7·2 answers
  • Can someone help me with this project im confused
    14·1 answer
  • It needs to be as simple as possible. Each question is slightly different.1. An arithmetic progression is a sequence of numbers
    7·1 answer
  • If an OS is using paging with offsets needing 12 bits, give the offset (in decimal or hexadecimal) to: the third word on a page
    10·1 answer
  • Write a recursive method to form the sum of two positive integers a and b. Test your program by calling it from a main program t
    8·1 answer
  • Choose all of the items that represent functions of an operating system.
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!