Opening the reading…
Opening the reading…
DSA FUNDAMENTALS › MATRIX BASICS
This is a scratch drill — your code runs, nothing is graded or recorded. No test cases, no expected output, no verdict.
TASK
Write the Java program so it prints the upper-triangle output and then the lower-triangle output of the fixed 4 x 4 matrix. Preserve four entries per row and print 0 at every excluded position.
OUTPUT
Sample4 2 7 1 0 5 3 8 0 0 11 12 0 0 0 16 4 0 0 0 9 5 0 0 6 10 11 0 13 14 15 16
What a finished answer prints, from the lesson. Nothing has run yet — press Run and this is replaced by your program’s own output.