while loop is skipping sometimes in simple program to show float value entered.

Below is simple program for user to enter and show float value in serial monitor
sometimes it wait for user to enter the value and sometimes it skips the loop and shows 0.00 in serial monitor.

/data from the monitor/

float change;

void setup() {

void loop() {

Serial.println(“enter float value to be displayed”);
while (Serial.available()==0){

Please help me to understand this

It's probably reacting to line endings sent by the serial monitor. Disable line endings in the monitor settings.

Line endings in serial monitor.

Or write a decent serial input parser... this common approach is just a toy...

Serial input basics.