GATE | CS | 2004 | C Programming | Loops & Conditionals | Question 42

Last Updated :
Discuss
Comments

What does the following algorithm approximate?

C
    x = m;
    y = 1;
    while (x - y > e)
    {
        x = (x + y)/2;
        y = m/x;
    }
    print(x);

(Assume m > 1, e > 0).

log m

m2

m1/2

m1/3

Share your thoughts in the comments