This should have been posted in the "Embedded Systems and Microcontrollers" forum.
"i need to find the maximum number in 20 samples that read from an adc"
This statement does not make sense.
If you take 20 samples, then you get 20 samples.
The ADC is 10 bit, 1024 steps.
"how to write the program?"
There are many examples on the Microchip's website in applications notes.