Computer Science, asked by Anonymous, 1 year ago

Answer my question fast!


No sparm answer

Attachments:

Anonymous: Nope.
Anonymous: 10 , 2

Answers

Answered by Anonymous
6

Hi

// 1st loop

// In condition we are making sure that "x" should be less than or equal to "y"------ 5 <= 50.. true

// y = 50/5.... so "y" became 10.. then we printed that on screen... "10"

// 2nd loop

// In condition we are making sure that "x" should be less than or equal to "y"------ 5 <= 10.. true

// y = 10/5.... so "y" became 2.. then we printed that on screen... "2"

// 3rd loop

// In condition we are making sure that "x" should be less than or equal to "y"------ 5 <= 2.. false!!!.. so we will get out f loop now..

so.. the output will be 10, 2


Anonymous: no comment
ayusi74: why
Anonymous: i got disturb with that.
Anonymous: mai to nhi hota disturb.. lol
Anonymous: oo.
Anonymous: but hum hote h disturb bahut .
Anonymous: apko karna h baat ap karo hum disturb nai karenge.
Anonymous: Thanks a ton!!
Anonymous: Why my answers don't get verified?
Answered by siddhartharao77
2

Sample Program:

x = 5, y = 50

while(x <= y)

{

y = y/x

System.out.println(y);

}

Actual Output: Compilation error

Expected output:

(i) 5 <= 50

{

y = (50/5) = 10

System.out.println(y);   ----------- 10

(ii) 5 <= 10

{

y = (10/5) = 2

System.out.println(y);    -------------- 2

(iii) 5 <= 2

Loop terminates.

Final output is:

10

2

Hope it helps!


Anonymous: thx bro u clear by doubt^_^
siddhartharao77: Welcome sis!
Similar questions