Rewrite the following do loop into a while loop. int n = in.nextInt(); double x = 0;

Question:

Rewrite the following do loop into a while loop.

int n = in.nextInt();
double x = 0;
double s;
do
{
s = 1.0 / (1 + n * n);
n++;
x = x + s;
}
while (s > 0.01);

Fantastic news! We've Found the answer you've been seeking!

Step by Step Answer:

Related Book For  book-img-for-question
Question Posted: