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
leonid [27]
3 years ago
5

What is wrong with the following C++ code? How would you fix it? int sum; for (int i=0; i<1000; ++i) sum += i; { printf("Sum

of 0 to 999 is %d\n", sum);
Computers and Technology
1 answer:
enyata [817]3 years ago
4 0

Answer:

Correct code is:

int sum;

  for (int i=0; i<1000; ++i)

  sum += i;

      printf("Sum of 0 to 999 is %d\n", sum);

Explanation:

In the problem code there is a open curly open bracket after the sum+=1;.

This open bracket will give an To fix this code, we remove this bracket from  the given code.Then this code will calculate sum of all number from 0 to 999.And the last line of the code will print the sum.

You might be interested in
What is the answers please
Gre4nikov [31]
which question are u referring too
6 0
3 years ago
Which of the following refers to the bottom pane of the Wireshark window where all of the information in the packet is displayed
Lorico [155]

Answer:

D) Hex Pane.

Explanation:

Hex Pane  is the bottom pane where whole information in the packet is shown in hexadecimal format on the left and also in character when possible and decimal also.It is the bottom pane of Wireshark window.

So we can say that Hex pane is referred to the bottom pane of the Wireshark window which displays the information in hexadecimal on the left .

5 0
3 years ago
Please please help I don’t understand this
garik1379 [7]

Answer:

It is this because yass

Explanation:

And yes

6 0
2 years ago
Read 2 more answers
What type of video games do you prefer buying?
Tamiku [17]
Mine is minecraft maybe
6 0
3 years ago
What is a circuit breaker and how is it different from a fuse? Why do we need these two different devices?
Liula [17]

Answer:

Circuit breakers and fuses both have the same purpose, but a fuse will melt when stopping electricity where as circuit breakers can just be reset. You need both devices in order to stop a overload of power that could fry your electronics or worse, start fires.

Explanation:

7 0
3 years ago
Read 2 more answers
Other questions:
  • Determine the number of bytes necessary to store an uncompressed binary image of size 4000 × 3000 pixels.
    9·1 answer
  • One subtask in the game is to roll the dice. explain why is roll the dice an abstraction.
    5·1 answer
  • Please help!! will fan and medal
    12·2 answers
  • Answer the following questions which are based on the study "Patients' Engagement with Sweet Talk." Submit your answers to the e
    9·1 answer
  • Consider a situation where we have a file shared between many people.  If one of the people tries editing the file, no other pe
    6·1 answer
  • What coding language should i begin with if i'm looking to get into AI ?
    11·1 answer
  • What helps companies and organizations to target masses of people, provide 24/7 services, and deliver better marketing in a chea
    10·1 answer
  • C:\windows\system32\drivers\etc\protocol is an example of a file ________. select one:
    5·1 answer
  • Which command would you use to swap the words hither and yon on any line with any number of words between them? (You need not wo
    5·1 answer
  • You are setting up a small network. The customer has decided to change his internet service provider (ISP) to EtherSpeed. The IS
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!