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]
4 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]4 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
Which of the following are benefits of designing a scalable system? Choose 3 options.
zhenek [66]

Which of the following are benefits of designing a scalable system? Choose 3 options.

  • ability to maintain a high level of service for customers ✔

system will never need to grow again

  • Ability to respond to user volume issues more quickly ✔
  • guaranteed system access for all users ✔

users may never know that a site has experienced tremendous growth

4 0
3 years ago
Which extension is appropriate for Word document templates?
expeople1 [14]
The answer to this question is A
8 0
3 years ago
Read 2 more answers
In the U.S. highway numbering system, north-south routes have
aniked [119]

Answer:

B. "1"

Explanation:

Major north–south routes have numbers ending in "1" while major east–west routes have numbers ending in "0".

Hope this helps!

5 0
3 years ago
Read 2 more answers
PLEASE I NEED HELP WITH THIS I WILL GIVE BRAINLIST!!!!!
Neko [114]
It would be so you like chocolate because there is only two options. Yes or no
8 0
3 years ago
Read 2 more answers
1. Accessing calendars, contact information, emails, files and folders, instant messages, presentation, and task lists over the
kotykmax [81]
QUESTION NO. 1 -

A. Cloud computing.


QUESTION NO. 2 -

C. Social networking.


QUESTION NO. 3 -

D. Task list.


QUESTION NO. 4 -

D. Powerpoint.


QUESTION NO. 5 -

B. Sandie should share the document in OneDrive and give her sister permission to edit the document.


QUESTION NO. 6 -

C. The design and arrangement of items for efficiency and safety.
8 0
3 years ago
Other questions:
  • Thomas is using a drawing program to complete a construction. Which construction could he be completing? (5 points).
    5·2 answers
  • True or false: a game design document is like a diary for game developers
    13·2 answers
  • The company currently runs 60 autonomous APs and has plans to increase wireless density by 50% in the near future
    13·1 answer
  • The "Rudolph Rule" is best described by which of the following?
    9·1 answer
  • Crack the secret message: Crrp, Crrp, Crrp Zh'uh jrlqj wr wkh prrq. Li brx zdqw wr wdnh d wuls, Folpe derdug pb urfnhw vkls. (hi
    8·1 answer
  • A microphone plugs into what type of connector
    5·2 answers
  • Which of the following software programs provides for e-mail communication?
    5·1 answer
  • An algorithm is a ________. a. simple thinking strategy for making decisions quickly and efficiently. b. testing method involvin
    6·1 answer
  • What is an example of bias in media?​
    9·1 answer
  • Consider this binary search tree:______.
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!