Question: In the following program segment, which variable is the counter and which is the accumulator? int x = 0 , y = 0 , z
In the following program segment, which variable is the counter and which is the accumulator?
int x y z;
coutHow many numbers do you wish to enter?
;
cin x;
while z x
int a;
coutEnter a number:
;
cina;
y a;
coutThe sum of those number is y endl;
Group of answer choices
y is the counter and x is the accumulator
y is the counter and z is the accumulator
y is the counter and a is the accumulator
z is the counter and a is the accumulator
z is the counter and y is the accumulator
z is the counter and x is the accumulator
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
