हिंदी

Analyze the following program segment and determine how many times the body of the loop will be executed (show the working). x = 5; y = 50; while (x <= y) { y = y / x; System.out.println(y); } - Computer Applications

Advertisements
Advertisements

प्रश्न

Analyze the following program segment and determine how many times the body of the loop will be executed (show the working). 

x = 5; y = 50; 
while (x <= y) 
  {
  y = y / x; 
  System.out.println(y); 
  }
संक्षेप में उत्तर

उत्तर

`50/5 = 10`

`10/5 = 2`

The loop is executed twice. 

shaalaa.com
  क्या इस प्रश्न या उत्तर में कोई त्रुटि है?
अध्याय 1.09: Iterative Constructs in Java - EXERCISES [पृष्ठ १२२]

APPEARS IN

अविचल Computer Applications [English] Class 10 ICSE
अध्याय 1.09 Iterative Constructs in Java
EXERCISES | Q III. 2. | पृष्ठ १२२
Share
Notifications

Englishहिंदीमराठी


      Forgot password?
Use app×