1(iii)
In a statement c = c + (x * d + e); which variable is an accumulator?
- (a)d
- (b)c
- (c)e
- (d)x
Show SolutionHide Solution↓
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.