@mohanphani2003
The first rule is NEVER compare floating point numbers (float or double) for equality (==) or inequality (!=). Floating point representations are approximations; you cannot predict which cases will compare precisely equal and which won't.
Even so, you might expect the equality comparison to work in your case. Notice that floating point literals are of type double unless you provide the "f" type suffix: for instance, "1.1f". Therefore, the comparison within the while statement is between float variable x and double constant 1.1; causing x to be promoted to a double. The promoted value of x has less precision that the constant, so the values compare not equal. If you are determined to proceed with this experiment, I suggest you either declare x as a double or add an "f" suffix to all of your floating pointer literal constants.
There's a link to a floating point tutorial that is often provided in cases like this. I can't find the site. Hopefully one of the other experts will give it to us.