मराठी

Predict the output: int i, j; first: for (i = 0; i < 5; i = i + 2) { second: for (j = 1; j <= 10; j++) { System.out.println("i=" + i + "j=" +); if (j == 2) break second; } } - Computer Applications

Advertisements
Advertisements

प्रश्न

Predict the output:

int i, j;
first:
for (i = 0; i < 5; i = i + 2)
{
     second:
     for (j = 1; j <= 10; j++)
     {
     System.out.println("i=" + i + "j=" +);
     if (j == 2)
       break second;
     }
}
थोडक्यात उत्तर

उत्तर

i = 0, j = 1
i = 0, j = 2
i = 2, j = 1
i = 2, j = 2
i = 4, j = 1
i = 4, j = 2

shaalaa.com
  या प्रश्नात किंवा उत्तरात काही त्रुटी आहे का?
पाठ 1.1: Nested Loop - Review Insight [पृष्ठ १४४]

APPEARS IN

अविचल Computer Applications [English] Class 10 ICSE
पाठ 1.1 Nested Loop
Review Insight | Q 8. | पृष्ठ १४४
Share
Notifications

Englishहिंदीमराठी


      Forgot password?
Use app×