Which of the following represents an example to calculate the sum of numbers (that is, an accumulator), given that the number is stored in the variable number and the total is stored in the variable total? A) total +number B) total +number =total C) total + number D) number+number

Respuesta :

Answer:

Input : n = 687

Output : 21

A

Input : n = 12

Output : 3

Step-by-step explanation:

The expression which is used to calculate the sum of numbers is option D which is number+number.

What is sum?

Sum is basically the total amount which we get from adding two or three numbers. The sign which  is used between numbers is +.

How to find sum?

We have to calculate sum of numbers. let's take options one by one with an example. Let's take first number be 1 and second number be 2.

A) total+number

Total of 1 and 2 =3

numbers =1,2

Expression gives=3+1+2=6

It does not gives total of numbers.

B) Total+number=total

Total of 1 and 2 =3

numbers =1,2

Expression gives=3+1+2=6

It does not equal to total of numbers.

C) Total+number

It is repeation of first option.

D) Number+Number

First number=1

Second number=2

Total of numbers=1+2=3

Expression:1+2

=3 which is the total of numbers.

It is correct.

Hence the expression  which tells us the sum of numbers is number +number.

Learn more about sum at https://brainly.com/question/542712

#SPJ2