Cant get a variable value in the "for" statement to display on lcd

I'm trying to display the variable "i" instantaneously on the lcd as shown in the code, but the code keeps displaying i=0, without changing. I've done all the lcd setup required, and included all the necessary libraries for displaying, yet the value of i does not change in the lcd display. Please I need help with it, cos if i cant see what i'm varying i cant tell whether it's actually varying.

    for (int i = 0; i <= 255; i++)
    {
      lcd.setCursor(0, 0);
      lcd.print(i);
      delay(10);
    }
    delay(500);
    for (int i = 255; i >= 0; i--)
    {
     lcd.setCursor(0, 0);
      lcd.print(i);
      
      delay(10);
    }
    return i;
}

Does it really display i=0 or just 0 ?
What do you see if you Serial.println() the variable ?

Please post your whole program not just part of it.