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

2nd Jun 2018, 3:50 AM
kama nick
kama nick - avatar
6 odpowiedzi
+ 1
Okay thanks buddy
2nd Jun 2018, 4:58 AM
kama nick
kama nick - avatar
0
did you try to make it
2nd Jun 2018, 3:58 AM
‎ ‏‏‎Anonymous Guy
0
Yeah but still don't understand the concept of array. like i said new in programming just started with java.
2nd Jun 2018, 4:10 AM
kama nick
kama nick - avatar
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
2nd Jun 2018, 4:16 AM
‎ ‏‏‎Anonymous Guy
0
Yeah thanks. How do you assign values into the array that you have created.
2nd Jun 2018, 4:27 AM
kama nick
kama nick - avatar
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;
2nd Jun 2018, 4:40 AM
‎ ‏‏‎Anonymous Guy