हिंदी

What is a nested loop? - Computer Applications

Advertisements
Advertisements

प्रश्न

What is a nested loop?

संक्षेप में उत्तर

उत्तर

'A nested loop is one that uses another loop within itself. In the example below, the outer loop is executed three times. The inner loop is executed twice per outer loop iteration. Therefore, the pattern printed will be: 

          MM
          MM
          MM

Example: 

for (int i = 1; i <= 3; i++)
{for (int j = 1; j <= 2; j++)
System.out.print("M");
System.out.printIn();
}
shaalaa.com
  क्या इस प्रश्न या उत्तर में कोई त्रुटि है?
अध्याय 1.1: Nested Loop - EXERCISES [पृष्ठ १४५]

APPEARS IN

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

Englishहिंदीमराठी


      Forgot password?
Use app×