In the following program segment, which variable is the loop control variable (also known as the counter variable) and which is the accumulator?
int a, x = 0, y = 0;Scanner keyboard = new Scanner(System.in);while (x < 10){ System.out.print("Enter a number: "); a = keyboard.nextInt(); y += a;}System.out.println("The sum is " + y);
We need at least 10 more requests to produce the solution.
0 / 10 have requested this problem solution
The more requests, the faster the answer.