Solved

How Many Times Does the Following Loop Execute? Double D;

Question 26

Multiple Choice

How many times does the following loop execute? double d;
Random generator = new Random() ;
Double x = generator.nextDouble() * 100;
Do
{
D = Math.sqrt(x) * Math.sqrt(x) - x;
System.out.println(d) ;
X = generator.nextDouble() * 10001;
}
While (d != 0) ;


A) Exactly once
B) Exactly twice
C) Can't be determined
D) Always infinite loop

Correct Answer:

verifed

Verified

Unlock this answer now
Get Access to more Verified Answers free of charge

Related Questions