This is the job of what's called a pull-up resistor (or a pull-down resistor, depending on how you're using it). The circuit you should use looks like this:

simulate this circuit – Schematic created using CircuitLab
The left one is using a pull-down resistor, and will read logic low (0 for active-high logic) whenever the switch is not pressed, and will read logic high when it is. The right one is the opposite, using a pull-up resistor; this reads logic high (1 in active-high logic) when the switch is not pressed, and logic low when it is.
You'll need one resistor for each input, but if that sounds like too much, you can get resistor networks that have many resistors in a single package, and some logic chips have internal pull-up or pull-down resistors; check your datasheet. If you're using a microcontroller, most of those allow you to configure their inputs to use an internal pull-up or pull-down resistor; look at your μC's datasheet for information on this. It's usually as simple as setting bits in a register somewhere.
The exact value of the resistor doesn't matter that much. The lower the resistor, the faster it can charge or discharge the input capacitance, but this only really matters when dealing with things that actuate much faster than pushbuttons, like an I²C bus. But also, the lower the resistor, the higher the current will be when the switch is pressed, so you don't want it too low. Somewhere in the range of 1kΩ to 100kΩ usually works fine.
A note since you're using a 7404 specifically: the 7404, as well as the 74LS04, has internal pull-up circuitry, so you don't need any resistors if you put your pushbutton between the input and ground. An unconnected input will be read as high.
The presence of this internal pull-up also means that if you want a pull-down, you're going to need to use a small resistor value since you'll be forming a voltage divider.
Note that the 74HC series, unlike most 74 variants, does not have internal pull-ups, so if your chip is actually a 74HC04 you will need an external resistor.