Arduino Uno has a built in ‘pull up’ resistor integrated into its circuit. We can use this resistor by using INPUT_PULL as the mode argument for the pinMode function.
By writing pinMode( 2, INPUT_PULLUP), the pin 2 on the MCU has Vcc = 5v and a pull up resistor. Following is the diagram for active low.
Please note that the pull up resistor and the 5v Vcc is inside the Arduino Uno circuitry itself . By stating pinMode (2, INPUT_PULLUP) in the sketch, we are telling the MCU to provide 5v through the in-built pull up resistor via pin 2 to itself.