PRO192_-_QUIZ2_-_SL4_3930.webp
Hữu Vinh

PRO192_-_QUIZ2_-_SL4_3930.webp

Question 19
Not yet
answered
Flag
question
What will be the output of the following code snippet?
public class Main {
public static void main(String[] args) {
int[] arr = {1, 2, 3, 4, 5};
for (int i = 0; i < arr.length / 2; i++) {
}
int temp = arr[i];
arr[i] = arr[arr.length - i - 1];
arr[arr.length - i - 1] = temp;
for (int i: arr) {
System.out.print(i + " ");
}
}
}
O a. 34512
O b. 34512
O c. 12345
O d. 54321

Thông tin

Category
PRO192
Thêm bởi
Hữu Vinh
Ngày thêm
Lượt xem
297
Lượt bình luận
2
Rating
0.00 star(s) 0 đánh giá

Share this media

Back
Bên trên Bottom