Solved

Show the Output That Would Occur from the Following Code

Question 17

Essay

Show the output that would occur from the following code, including proper spacing.
for (j = 0; j < 5; j++)
{
for (k = 0; k < 5; k++)
if (j!=k)
System.out.print(' ');
else
System.out.print('*');
System.out.println( );
}

Correct Answer:

verifed

Verified

*
*
*
*
*
The outer loop iterates from 0...

View Answer

Unlock this answer now
Get Access to more Verified Answers free of charge

Related Questions