When the switch is closed, the transistor goes into saturation, due to which the voltage at the output is zero.
When the switch is open, the transistor goes into Cut-off State, as there is no base current. Hence the collector current drops to zero. Now, as there is no current flowing through resistor, the collector voltage rises to the supply voltage (5V) and voltage at the output is 5V.
Thus, the above circuit can be used as digital circuit.