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
What are vertical sets of cells called
Nady [450]
A vertical group of cells are called (C) column
6 0
3 years ago
Read 2 more answers
The five types of personal computers are: desktops, laptops, tablets, smartphones, and
shepuryov [24]

Answer:

microcomputers

Explanation:

8 0
3 years ago
Linda wants to change the color of the SmartArt that she has used in her spreadsheet. To do so, she clicks on the shape in the S
Julli [10]

Answer: Theme colors

Explanation:

Based on the directions, Linda most probably went to the "Theme colors" option as shown in the attachment below. Theme colors enables one to change the color of their smart shape.

It is located in the "Format tab" which is under "Drawing tools" in the more recent Excel versions. Under the format tab it is located in the Shape Styles group as shown below.

8 0
2 years ago
At the ________ level of an organization, functional managers focus on monitoring and controlling operational-level activities a
Anon25 [30]

Answer:

Tactical Level

Explanation:

Based on the information provided within the question it can be said that the level of the organization that is being mentioned is called the Tactical Level. In this level managers focus choosing the tactics depending on the information that they gather from everyday operational activities. This information is later sent to the higher levels of the organization.

7 0
3 years ago
Read 2 more answers
In linux ext file systems, a files data block addresses/numbers are stored in
MariettaO [177]
I think the answer is the superblock
4 0
3 years ago
Other questions:
  • Prompt the user for a string that contains two strings separated by a comma. (1 pt)Examples of strings that can be accepted:Jill
    5·1 answer
  • Assume that the 100,000 element integer array that you allocated starts at address 0x50000000 in memory, the size of an integer
    6·1 answer
  • Need help ASPA!!!!!!!!!
    9·2 answers
  • Which encryption standard goes with the WPA2 protocol?<br> AES<br> DES<br> TKIP<br> WPS
    10·1 answer
  • Laxmi was not confident that she could learn to program a computer. When she found out that two girls with similar GPA’s in her
    5·1 answer
  • What do you think is the most fascinating aspect of the Internet
    5·2 answers
  • What are TWO examples of soft skills?
    11·1 answer
  • Complete the sentence.
    5·1 answer
  • For angular how can we set up th edatabse.
    11·1 answer
  • Which one did I buy the iPhone 13 or the Samsung S22 Ultra?
    14·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!