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
melomori [17]
4 years ago
15

c++ Write a for loop that computes the following sum: 5+10+15+20+...+485+490+495+500. The sum should be placed in a variable sum

that has already been declared and initialized to 0. In addition, there is another variable, num that has also been declared. You must not use any other variables.
Computers and Technology
1 answer:
ElenaW [278]4 years ago
5 0

Answer:

#include <iostream>

#include <cstdlib>

 

using namespace std;

 

int main(){

 

 

   int sum=0, num=5;   //variables declaration and inicialization

 

   while (sum<500){   //conditioning to do the sum up to 500

   sum=sum+num;     //actually sum process

   cout << "The value is: "<<sum;   //show the result in screen

   };

   return 0;

}

You might be interested in
What skills used in video game play could be useful in scientific problem-solving games such as Foldit?
Sidana [21]
For the answer to the question above asking w<span>hat skills used in video game play could be useful in scientific problem-solving games such as Foldit?
Playing that game, it involves "critical thinking and puzzle solving skills. You need to solve </span><span>a protein-folding game like </span><span>unlock the structure of an AIDS-related enzyme.</span>
6 0
3 years ago
Allison needs to graph the yearly average snowfall in Alaska. She should use a:
bazaltina [42]

C: bar graph

bar graphs are used to track changes over time, so I would say that C is your best bet

7 0
4 years ago
Read 2 more answers
Guys i keep trying to get in touch with brainly but it says "your request could not be submitted" Can someone please help me ?
Ann [662]
Sure what is your question? It also happened to me too
What grade are you in
7 0
2 years ago
Read 2 more answers
How do you ask brainy a question without it not liking the question and saying it hurts their feelings?
murzikaleks [220]
IM SORRY but i dont now your question

7 0
3 years ago
What should the car be programmed to do if it encounters an unavoidable accident? (about autonomous vehicles)(help me :c)
sashaice [31]

Answer:

The nation proposed that: “self-driving cars should always attempt to minimize human death and shouldn't discriminate between individuals based on age, gender, or any factor. Human lives should also always be given priority over animals or property” (Nowak).

4 0
3 years ago
Other questions:
  • Universal Windows Platform is designed for which Windows 10 version?
    7·1 answer
  • In a(n) ________ either one condition or some other condition must be met in order for an event to take place.
    11·1 answer
  • A bakery collects data on sales. Each sales record includes the date of the sale and some metadata about the items that were par
    11·1 answer
  • SATCOM in the Ku- and Ka- bands, as well as EHF systems are adversely affected by rain (the higher the frequency, the greater th
    14·1 answer
  • Three Strings someone help
    15·1 answer
  • Which of the following is not a Nintendo game character?
    6·2 answers
  • Free pass if you want it.
    12·2 answers
  • Which is the correct notation to specify the following inheritance?
    8·1 answer
  • What is binary ????????
    5·2 answers
  • Need this java code its on zybooks. given two integers as user inputs that represent the number of drinks to buy and the number
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!