हिंदी

Analyze the Given Program Segment and Answer the Following Questions: (I) Write the Output of the Program Segment. (Ii) How Many Times Does the Body of the Loop Gets Executed?

Advertisements
Advertisements

प्रश्न

Analyze the given program segment and answer the following questions:

(i) Write the output of the program segment.
(ii) How many times does the body of the loop gets executed?

for (int m=5; m<=20;m+=5)
{   if(m%3==0)
   break;
else
if(m%5==0)
System.out.println(m);
continue;
}

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

उत्तर

(i)

Output:
5
10
(ii)

3 times

shaalaa.com
Introduction of Nested Loop
  क्या इस प्रश्न या उत्तर में कोई त्रुटि है?
2015-2016 (March)

APPEARS IN

Share
Notifications

Englishहिंदीमराठी


      Forgot password?
Use app×