No products in the cart.

How many times the body of …

CBSE, JEE, NEET, CUET

CBSE, JEE, NEET, CUET

Question Bank, Mock Tests, Exam Papers

NCERT Solutions, Sample Papers, Notes, Videos

How many times the body of loop will be executed:

int x=5,y=50;

While (x<=y)

{

y=y/x;

jTextField1.setText(""+y);

}

  • 1 answers

Naveen Sharma 7 years, 9 months ago

Ans. 2 times 

First time as (5<= 10 ) so condition true

Now y = 10 and  x = 5 

Second time as ( 5 <= 10 )

now y = 2 and x = 5 

now condition is false. 

http://mycbseguide.com/examin8/

Related Questions

Select round(6.5675,2);
  • 0 answers
Founder of python
  • 2 answers

myCBSEguide App

myCBSEguide

Trusted by 1 Crore+ Students

Test Generator

Test Generator

Create papers online. It's FREE.

CUET Mock Tests

CUET Mock Tests

75,000+ questions to practice only on myCBSEguide app

Download myCBSEguide App