-
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathArray15.java
More file actions
24 lines (21 loc) · 548 Bytes
/
Copy pathArray15.java
File metadata and controls
24 lines (21 loc) · 548 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
package array;
/**
* Project Admin -> Husanboy Azamov
* Package Name -> array
* Class Date -> 6/22/2022/ 1:24 AM
*/
public class Array15 {
public static void main(String[] args) {
int [] r={1,2,3,4,5,6,7,8};
array15(r);
}
public static void array15(int[] array){
for (int i = 1; i < array.length; i+=2) {
System.out.print(array[i]+" ");
}
System.out.println();
for (int i = array.length-2; i >=0 ; i-=2) {
System.out.print(array[i]+" ");
}
}
}