it converts the analog input from port a to digital input for comparision.
the problem in the above program is the statement
OpenADC(ADC_FOSC_2 & ADC_LEFT_JUST & ADC_1ANA_0REF, ADC_CH0 & ADC_INT_OFF);//setup adc
the error its showing is "Error  symbol 'ADC_1ANA_0REF' has not been defined"
the output is stored in the registers