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
Your new home has a vacuum system. what kind of computer is controlling it?
Scrat [10]
The answer is embedded computer. It is a PC framework with a committed capacity inside a bigger mechanical or electrical framework, frequently with ongoing figuring constraints. It is implanted as a component of a total gadget regularly including equipment and mechanical parts. Installed frameworks control numerous gadgets in like manner utilize today.
6 0
4 years ago
If 2 people use my code D9R2M on fetch reward and scan receipts I will give brainliest ​
Ganezh [65]

Answer:

kay

Explanation:

5 0
3 years ago
Read 2 more answers
What is a graphics card and what does it do?
prisoha [69]
Its basically a chip in a computer microprocessor, it allows the microprocessor to work at full speed. it also hamdles video calculation within the computer.
6 0
4 years ago
Read 2 more answers
Plz plz plz subsribe to my channel, CookieFunTime
Nesterboy [21]

ok ok ok ok ok ok ok ok ok ok ok ok ok ok ok ok ok ok ok ok ok ok ok ok ok ok

7 0
3 years ago
Do you need special software to create a web page?
Serjik [45]

Answer:

Many websites these days have done it for you, (Wix, Squarespace ect.)

If you want to start from scratch however, then I believe you do, I have only researched these websites which do it for you.

Hope this helped :)

5 0
4 years ago
Read 2 more answers
Other questions:
  • At what point is an idea protected by copyright?
    7·2 answers
  • What internet access technology currently uses a technology called 4G?
    13·1 answer
  • Explain the applications software that you use everyday
    5·1 answer
  • Factoring is the revers of​
    14·1 answer
  • Read the citation example, and then use the drop-down menus to identify each part.
    8·2 answers
  • ________ include programs such as word processing, spreadsheet, database,presentation graphics. Personal information,
    6·1 answer
  • Cathy designed a website for a cereal brand. When users view the website, their eyes first fall on the brand name, then they vie
    14·1 answer
  • What is the error in this program?
    9·1 answer
  • list three things that can spoil a printer if they are not of the correct specification and explain what damage may be caused​
    15·1 answer
  • Write an if-else statement for the following: If user_tickets is less than 5, assign num_tickets with 1. Else, assign num_ticket
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!