actually a program in this site in microcontrollers-avr is avialable.
i have pasted it below.
only thing is you need a interfacing diagram which is a single pin of LM 35 going to microcontroller and the rest 2 are vcc and ground.
you can get diagram from net.
i think it will work.
if the below code does not work in some software try to change the header file.
// Program to take input from a particular pin in AVR Microcontroller (ATmega16) #include<avr/io.h> #include<util/delay.h>
int main (void)
unsigned int i=0;
DDRA=~_BV(PA0); // PA0 as input pin
if(bit_is_set(PINA,PA0)) //If PA0=1
if(bit_is_set(PINA,PA0))//Check it again due to swithc debouncing
PORTD=(PORTD<<1); //Left shift value of PORTD by 1