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]
2 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]2 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
How do I go to files in Brainly I need help
Lyrx [107]

Answer:

There should be a little icon at the bottom of your question box/answer box. It looks like a paper clip. click it and boom

Explanation:

4 0
3 years ago
The process of learning by making mistakes and by trial and error is called _____.
vodomira [7]
I believe it’s problem solving.
6 0
2 years ago
Which of the following can be used to locate data in a particular column?
dangina [55]

Answer:

A. VLOOKUP

Explanation:

VLOOKUP is an Excel function to look up data in a table organized vertically. VLOOKUP supports approximate and exact matching, and wildcards (* ?) for partial matches. Lookup values must appear in the first column of the table passed into VLOOKUP.

Purpose 

Lookup a value in a table by matching on the first column

Return value 

The matched value from a table.

Syntax 

=VLOOKUP (value, table, col_index, [range_lookup])

Arguments 

value - The value to look for in the first column of a table.

table - The table from which to retrieve a value.

col_index - The column in the table from which to retrieve a value.

range_lookup - [optional] TRUE = approximate match (default). FALSE = exact match.

4 0
2 years ago
What is the minimum number of bits you need to encode the 26 letters of the alphabet plus a space?Pace?
Andrei [34K]

Answer

5 bits

Explanation

A bit is the least or the smallest unit of data in a computer. They are  the units of information in information theory, consisting of the amount of information required to specify one of two alternatives 0 and 1. This is because A bit has a single binary value, either 0 or 1

If you use roman alphabet A to Z lets use log 2(26)=4.7 bits. when you round off it will be 5 bits.

8 0
3 years ago
Driving at slower speeds than traffic flow _____________ .
UNO [17]
The answer is B. may impede other vehicles on the road that are traveling at a normal and safe speeds
4 0
3 years ago
Other questions:
  • From the video "Your Password Sucks", using computer power to guess your password by trying multiple variations one after the ot
    15·2 answers
  • Each organization that provides host services on the public Internet is responsible for providing and maintaining DNS authoritat
    7·1 answer
  • Mr. Olgesandravich is proctoring students working at their own pace in an online class. He is generating a spreadsheet that show
    15·1 answer
  • When a user runs an application, what transfers from a storage device to memory?
    8·1 answer
  • Write any two use of computer in school​
    15·1 answer
  • A customer in a store is purchasing 5 items. Write a python program that asks for the price of each item and display the subtota
    14·1 answer
  • William found out that someone used his report on American culture without his permission. What is William a victim of?
    8·2 answers
  • Suppose a MATV/SMATV (Satellite Master Antenna Television) firm has to start it's operation in the metropolitan area of a countr
    12·1 answer
  • How would a barcode reader be used in a healthcare industry?​
    6·1 answer
  • your sales operations group would like to perform monthly analyses on large amounts of sales activity. they want to be able to r
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!