0
Write a program in java using an array to check if a set of numbers is even or odd. The user have to input the numbers in arrays
6 Antworten
+ 1
Okay thanks buddy
0
did you try to make it
0
Yeah but still don't understand the concept of array. like i said new in programming just started with java.
0
kama nick array as you can see is used for storing multiple data of similar data type
an integer array can store multiple ints, a char array can store multiple character, etc
You can access the elements from an array using index
index starts from 0 i.e first element has index number zero.
now if you have any specific doubt you can ask here
0
Yeah thanks. How do you assign values into the array that you have created.
0
You can use for or while loop for this purpose
eg
int [] arr;
Scanner in = new Scanner(System.in);
for(int i=0; i<7; i++)
arr[i]=in.nextint();
or directly use index number
eg
arr[3] = 7;