Problem with temperature sensor.

I connected a temperature sensor LM 35 (centigrade scale) temperature sensor. I connected its pins correctly. When I use the following code I am getting a value of 6 in Serial port.Is something wrong with my sensor or is it the code? .Can some one point out what's wrong.

int tempPin = 0;
int temp;
void setup()
{
  Serial.begin(9600);
}

void loop()
{
  temp = analogRead(tempPin)/10;
  Serial.println(temp);
}

What temperature is it in the room?

Check out this:

Ufoguy:
I connected its pins correctly.

What do you mean by 'correctly'? Which pin have you got the sensor connected to, and how is it connected?

I connected the pins with a breadboard and jumper wire .
The room temperature is around 30 degrees.
I connected the first pin to 5 volts second pin to A0 and the third pin to GND.
There seems to be something wrong with analog read.

I'm sorry. Looks like I used the wrong formula. I used the formula in the above link and everything works fine. It shows that the room temperature is 33 degrees now which is correct.

The formula was " tempC = (5.0 * tempC * 100.0)/1024.0; "