I'm trying to code an array that will make user print in 125 digits and then add the sum of it, this works but im trying to make the message like:
Please enter digit : 1
please enter digit : 2
Please enter digit : 3
...
Do i have to make a new int for this to work?
this is my current code
import java.util.Scanner;
public class jasam {
public static void main (String[] args) {
Scanner scan = new Scanner(System.in);
int[] array = new int [125];
int sum = 0;
int counter = 0;
while(sum < 125){
System.out.println("Please enter digit:" );
array[counter]=scan.nextInt();
sum += array[counter];