And, if it wasn't clear:
When you have a pin that is an input... and it's connected to a switch that may be on or off (assuming off = not connecting the pin to something else) or it otherwise might not be electrically connected to the rest of the circuit, the pin is said to be floating. A "floating" pin will read random values, because it will pick up ambient electromagnetic fields (this is the basis of how antennas work).
It is unclear why you have the 4.7k resistor and capacitor there - they don't look like they're doing anything for you. I suspect you meant to put them somewhere else to get some sort of RC delay, or filter noise, or something? But that's the wrong place for them for that purpose.
Usually when working with a switch, you reverse the logic, so the switch connects the pin to ground - then you can set pinMode(pin,INPUT_PULLUP) and use the internal pullup in the arduino to pull it up to vcc when the button isn't pressed, saving you an external part.