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
Karo-lina-s [1.5K]
3 years ago
10

I need a C++ program to ask the user to put in different numbers until zero is pressed then the program counts the numbers that

are put in and finds the sum of the numbers and the negative numbers.
Computers and Technology
1 answer:
frozen [14]3 years ago
7 0

Answer:

#include <iostream>

using namespace std;

int main()

{

int input = 0;

int count = 0;

int sum = 0;

int sumNegative = 0;

while (true) {

 cout << "Enter a number: ";

 cin >> input;

 if (input == 0) break;

 count++;

 sum += input;

 if (input < 0) {

  sumNegative += input;

 }

}

cout << "Count of the numbers: " << count << endl;

cout << "Sum of all the numbers: " << sum << endl;

cout << "Sum of the negative numbers: " << sumNegative << endl;

}

Explanation:

Your requirements regarding the sum and the negative numbers was a bit vague so I just did something you can probably adjust easily to your liking.

You might be interested in
Select the correct answer.
Vedmedyk [2.9K]
D because of the sun
6 0
3 years ago
Is there anybody who knows eris quirk but me- i feel lonely rn ;-;
Nutka1998 [239]

Answer:i do Eri's Quirk allows her to rewind an individual's body to a previous state. She has shown the ability to rewind someone's body to a point before they existed, which she accidentally did to her father.

3 0
3 years ago
Read 2 more answers
Dawn is trying to find out how much weight she can push across the room. She is really trying to find her __________. A. flexibi
Marrrta [24]

<em>The correct answer is d. muscular strength.</em>

<em></em>

<em>Explanation :</em>

<em></em>

<em>The maximal force a muscle can create when it contracts is referred to as muscular strength. When compared to someone with lower physical strength, someone with better muscular strength can lift heavier weights. Lifting progressively larger weights over time and eating a diet rich in protein-based foods can help a person's physical strength gradually grow.</em>

<em></em>

<em>I hope this helps. Please mark "Brainliest" if you can.</em>

8 0
2 years ago
Will sum1 come bust me outta FCA....replies u gotta live in knoxville though
snow_tiger [21]

Answer:

im on my way cuz

Explanation:

4 0
3 years ago
Read 2 more answers
Can a user account be used to log in to the system before its password is set?
-Dominant- [34]
No it can not it needs to have a password to log in.
6 0
3 years ago
Read 2 more answers
Other questions:
  • Here's something to stop you from getting repetitive when writing essays. Write a program that reads multiple lines of plain tex
    15·1 answer
  • In this problem we consider sending real-time voice from Host A to Host B over a packet-switched network (VoIP). Host A converts
    12·1 answer
  • According to the family life course development framework, the __________ stage of the family life cycle comes to an end with th
    7·1 answer
  • 15. What type of presentation includes information created in a different Office application?
    7·1 answer
  • What was one of the first inventions that made it possible to communicate almost instantly?
    11·1 answer
  • Joe runs a handyman service. He enjoys writing and keeping up on the latest trends. He wants to share this information with his
    14·1 answer
  • As a general rule, what is the size of a brochure?
    11·1 answer
  • Need help on Assignment 4: Evens and Odds
    5·1 answer
  • Hey should I get a r()blox gift card if so what amount 5 dollars 10 or 100
    14·1 answer
  • Which of the following statement is correct ? A . potential difference is measured by ammeter . B . The unit of potential differ
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!