KnowledgeBoat Logo
|

Computer Applications

In a statement c = c + (x * d + e); which variable is an accumulator?

  1. d
  2. c
  3. e
  4. x

Java Operators

6 Likes

Answer

c

Reason — In the statement c = c + (x * d + e);, the variable c appears on both sides of the assignment and continuously stores the updated result by adding new values to its previous value, which is the defining property of an accumulator. The variables x, d, and e are only used to compute the expression once and do not store cumulative results, hence they are not accumulators.

Answered By

3 Likes


Related Questions