logo

Crowdly

What does the following pattern print? for (int i = 1; i <= 5; i++) {     f...

✅ The verified answer to this question is available below. Our community-reviewed solutions help you understand the material better.

What does the following pattern print?

for (int i = 1; i <= 5; i++) {

    for (int j = 1; j <= 5; j++) {

        if (i == j)

            System.out.print("1 ");

        else

            System.out.print("0 ");

    }

    System.out.println();

}

0%
0%
100%
More questions like this

Want instant access to all verified answers on moovit.vit.ac.in?

Get Unlimited Answers To Exam Questions - Install Crowdly Extension Now!