Quadrition Quadrition - 1 year ago 81
C# Question

While doesn't approve true requirement

Variable i will be 0 in the end. Am I having serious problem in visual studio or in my brain?

double value = 0.0001;

int i = 0;

while(value < 0)
value *= 10;


Answer Source

The code inside the while block never runs because your while condition is actually false.

Your condition: 0.0001 < 0

This is a false statement so the while block is skipped.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download