nerdexam
Oracle

1Z0-409 · Question #40

What would be the output of the nested for loop given below? for (( i=1; i<=5; i++ )) do for (( j=1; j<=i; j++ )) do echo -n "$j" done echo " " done

The correct answer is A. 112123123412345. See the full explanation below for the reasoning.

Question

What would be the output of the nested for loop given below? for (( i=1; i<=5; i++ )) do for (( j=1; j<=i; j++ )) do echo -n "$j" done echo " " done

Options

  • A112123123412345
  • B123451234123121
  • C1234512345123451234512345
  • D123451234123123412345

How the community answered

(42 responses)
  • A
    76% (32)
  • B
    2% (1)
  • C
    7% (3)
  • D
    14% (6)

Community Discussion

No community discussion yet for this question.

Full 1Z0-409 Practice