-
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathArray52.java
More file actions
29 lines (24 loc) · 665 Bytes
/
Array52.java
File metadata and controls
29 lines (24 loc) · 665 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
25
26
27
28
29
package array;
import array.uitl.ArrayUtil;
import java.lang.reflect.Array;
/**
* Project Admin -> Husanboy Azamov
* Package Name -> array
* Class Name -> Array52
* Copyright © : 6/26/2022
*/
public class Array52 {
public static void main(String[] args) {
array52(new int[]{5,12,4,3,7,3,4},new int[]{3,2,6,12,4,17,32});
}
public static void array52(int []array1, int [] array2){
for (int i = 0; i < array1.length; i++) {
if (array1[i]<5){
array2[i]=2*array1[i];
}else {
array2[i]=array1[i]/2;
}
}
ArrayUtil.show(array2);
}
}