adplus-dvertising
frame-decoration

Question

Select output for the following set of code :
static void Main(string[] args)
{
    float i = 1.0f, j = 0.05f;
    do
    {
        Console.WriteLine(i++ - ++j);
    }while (i < 2.0f && j <= 2.0f);
    Console.ReadLine();
}

a.

0.05

b.

-0.05

c.

0.95

d.

-0.04999995

Posted under C# programming

Answer: (d).-0.04999995

Engage with the Community - Add Your Comment

Confused About the Answer? Ask for Details Here.

Know the Explanation? Add it Here.

Q. Select output for the following set of code :