0
How Can I Display The Number Of The Array in The Output using a Loop???? Example (I Want the Output 2 B Like This) "Please Enter the Array's Element Number 0:" "Please Enter the Array's Element Number 1:" and So On.....
4 Réponses
+ 3
when you are using loop to print something just print that variable as well..
e.g.
for(i=0;i<4;i++){System.out.println("please enter array element" + i);
}
+ 3
Use a for loop:
for(int i; i < array.length; i++){
System.out.println("Please Enter the Array's Element Number " + i + ":");
array[i] = scanner.nextInt();
}
+ 1
Oops I forgot:
for(int i = 0;...
^
+ 1
@Fabián
Haha...Don't Worry About it I'm not That Dumb xP