A(n) _____ is always incremented by a constant amount, whereas a(n) _____ is incremented by an amount that varies

accumulator, counter
counter, accumulator
accumulator, accumulator
counter, counter

The correct answer is: A(n) counter is always incremented by a constant amount, whereas a(n) accumulator is incremented by an amount that varies.

A counter is a variable that is used to keep track of the number of times something has happened. It is typically incremented by 1 each time the event occurs. For example, a counter could be used to keep track of the number of times a button has been pressed.

An accumulator is a variable that is used to store a sum of values. It is typically incremented by the value of another variable each time the event occurs. For example, an accumulator could be used to store the total number of items in a list.

In the given question, the correct answer is A because a counter is always incremented by a constant amount, whereas an accumulator is incremented by an amount that varies.

Exit mobile version