हिंदी

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

Advertisements
Advertisements

प्रश्न

Predict the output:

int i, j;
first:
for (i = 1; i < 10; i = i + 2)
{
      for (j = 3; j >= 1; j = j - 2)
      {
      if (i > 5)
        break first;
      System.out.println("i=" + i + ",j=" + j);
      }
}
संक्षेप में उत्तर

उत्तर

i = 1, j = 3
i = 1, j = 1
i = 3, j = 3
i = 3, j = 1
i = 5, j = 3
i = 5, j = 1

shaalaa.com
  क्या इस प्रश्न या उत्तर में कोई त्रुटि है?
अध्याय 1.1: Nested Loop - Review Insight [पृष्ठ १४४]

APPEARS IN

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

Englishहिंदीमराठी


      Forgot password?
Use app×