@Sherkann, setting the pinMode() prior to analog input has no affect since the pin is set to INPUT (floating) by the function. Reading a floating (unconnected) analog input will give you a random value due to noise on the pin. Connecting the pin to GND or 3V3 will produce zero and 4095 respectively and as expected. You can use external pull-up or pull-down resistors as required.