Analyze the given program segment and answer the following questions:
for(int i=3;i<=4;i++ ) { for(int j=2;j
- How many times does the inner loop execute?
- Write the output of the program segment.
Views 23
Answer:
-
Inner loop executes 3 times.
(For 1st iteration of outer loop, inner loop executes once. For 2nd iteration of outer loop, inner loop executes two times.) -
Output:
WIN
WIN
Related Articles:
This section is dedicated exclusively to Questions & Answers. For an in-depth exploration of Java Programming Language, click the links and dive deeper into this subject.
Join Our telegram group to ask Questions
Click below button to join our groups.