Show the output that would occur from the following code inc

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(  );
     }
}

Solution

The output is:

*

*

*

*

*

Every line without star has a space.

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.o

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site