Exam 1z0-808 All QuestionsBrowse all questions from this exam
Question 78

Given the code fragment:

What is the result?

    Correct Answer: D

    The given code iterates over a 2-dimensional array in reverse row order. The outer loop starts from the last row and moves to the first row. For each row, the inner loop prints each element sequentially. The array is {{1, 3}, {2, 4}}. The outer loop starts with the second row (i=1), printing 2 and 4, followed by the first row (i=0), printing 1 and 3. Thus, the output is 2413.

Discussion
DJavaOption: B

Wrong question. Result: 2313

rasiferOption: B

Answer is: 2 3 1 3 (TESTED)

a_really_reliable_programmer

No Answer. 2413 Reason: Outer for -> 1 -> 0 Inner loop for 1 -> {2,4} Inner loop for 0 -> {1,3} Answer 2413.

Omar_DeebOption: D

Answer Tested : 2413 code : int n [][] = { {1,3},{2,4} }; for (int i = n.length-1; i >= 0; i--) { for(int y : n[i]) { System.out.println(y); } }

AhmadTechie

Correct Answer is 2413

akbiyik

Answer should be 2413

dsms

Pay attention !!! No such option among A,B,C,D. The correct output is 2413.

winfred_lu

The correct output is 2413. No such option among A,B,C,D.

CreazyyyyGirl

2413 is the correct output. Option is not present

jimcounOption: A

Correct answer is 2413. Run the code: int n[][] = {{1, 3}, {2, 4}}; for (int i = n.length - 1; i>= 0; i--) { for (int y : n[i]) { System.out.print(y); } }

AhmadTechieOption: D

public static void main(String[] args) { int[][] n = {{1, 3}, {2, 4}}; for (int i = n.length - 1; i >= 0; i--) { for (int y : n[i]) { System.out.print(y); } } }

mesonjesi

Correct answer is 2413

DarGrin

Correct answer is 2413

Sreeni_A

No answer in the mentioned list. Answer is 2413 and tested locally

Rajeevkuamr

Answer should be 2413

tuyetan

Output: 2413

Kolodets

2413, wrong question