Problem with lm35 and the arduino uno board

I am making a thermometer with a lm35 and some leds. My problem is with the sketch " I think it is good" but I dont know why it doesn´t work.
This is my program:

int led[7] = { 3, 4, 5, 6, 7}; // Assign the pins for the leds

float grad;
int i,a;
void setup()
{
for (i = 0; i < 7; i++)
  pinMode(led[i], OUTPUT);
Serial.begin(9600); 
}

void loop()
{
grad = (5.0 * analogRead(0)*100.0)/1023.0; //convert to °C
Serial.println(grad);
delay(500);
if (grad==28){
  a=1;}
  else if (grad==29){
    a=2;}
    else if (grad==30){
      a=3;}
      else if(grad==31){
        a=4;}
        else if (grad==32){
          a=5;}
          else if (grad==33){
            a=6;}

  if (a == 0)  
   {
   for(i = 0; i < 7; i++)
     {
     digitalWrite(led[i], LOW);
     
     }
  }
  
  else
  {
   for (i = 0; i < a; i++) 
    {
     digitalWrite(led[i], HIGH);
     
    }
    
    for(i = i; i < 7; i++)  
     {
      digitalWrite(led[i], LOW);
      
     }
  }
}

When I open the serial monitor the arduino give me in the first value the temperature of the room but next it give me other values I don't know why. When I use the variable grad as a float value it give me the real temperature (for this reason I think that the lm35 is ok) of the room but for this sketch i need the temperature as a integer. Anyone know what could be the problem.

Do you have it powered with the USB ?
Turning on all the leds could lower the 5V too much.

Are there any leds connected ? With resistors ?

When trying to make something work, it is normal to have a number of test sketches.
You could try to make a new test sketch, and remove all the led code. Just write the temperature to the serial monitor.
Once that is stable and working well, you can go on and add the leds.
Your calculation is with float, so it is easier to have all the temperatures with float. You have to change the sketch for that.

float temperature;

if( temperature < 25.0)
{
  // too cold to show a led.
}
else if( temperature < 26.0)
{
  // temperature between 25.0 and 26.0
}
else if (temperature < 27.0)
{
  // temperature between 26.0 and 27.0
}
else
{
  // None of the above, so the temperature must be above 27.0
}