answersLogoWhite

0

A total is a variable that accumulates the sum of several numbers.

Answer is based on C How to Program (6th Edition)

User Avatar

Wiki User

14y ago

Still curious? Ask our experts.

Chat with our AI personalities

CoachCoach
Success isn't just about winning—it's about vision, patience, and playing the long game.
Chat with Coach
BeauBeau
You're doing better than you think!
Chat with Beau
ReneRene
Change my mind. I dare you.
Chat with Rene

Add your answer:

Earn +20 pts
Q: What is a variable that accumulates the sum of several numbers?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Continue Learning about Engineering

What variable keeps a running total?

The answer is "an accumulator." "A running total is a sum of numbers that ACCUMULATES with each iteration of a loop. The variable used to keep the running total is called an accumulator." It can be any variable you want! It could be total, tot, etc. Here is an example: total = 0 randoms = [random.randRange(0, 99999)] * 100 # Creates a list of 100 random numbers for number in randoms: total += number print(total) # Py3k print statement. Sample output: 35460


Write algorithm compute sum of square of N numbers?

Oh, what a lovely question! To compute the sum of the squares of N numbers, you can create a simple algorithm. Start by initializing a variable to hold the sum, then loop through each number, square it, and add it to the sum. Once you've done this for all N numbers, you'll have the sum of their squares. Just like painting a happy little tree, take your time and enjoy the process.


How to Declare a variable that stores the cumulative sum java?

In Java:You declare the variable like this:int sum;If you want to include decimals, change this to:double sum;To store an initial value, just use the assignment operator:sum = 0;You can combine this with the declaration:double sum = 0.0;To add something to the variable, for example the value of a variable called "x", use one of the following:sum = sum + x;sum += x;In Java:You declare the variable like this:int sum;If you want to include decimals, change this to:double sum;To store an initial value, just use the assignment operator:sum = 0;You can combine this with the declaration:double sum = 0.0;To add something to the variable, for example the value of a variable called "x", use one of the following:sum = sum + x;sum += x;In Java:You declare the variable like this:int sum;If you want to include decimals, change this to:double sum;To store an initial value, just use the assignment operator:sum = 0;You can combine this with the declaration:double sum = 0.0;To add something to the variable, for example the value of a variable called "x", use one of the following:sum = sum + x;sum += x;In Java:You declare the variable like this:int sum;If you want to include decimals, change this to:double sum;To store an initial value, just use the assignment operator:sum = 0;You can combine this with the declaration:double sum = 0.0;To add something to the variable, for example the value of a variable called "x", use one of the following:sum = sum + x;sum += x;


What do you call the result of adding two numbers?

The sum.


What are advantages of using the sum function?

It gives you the sum of two or more numbers.