An alternative method of preparing the pseudo-pure state of a spin system for quantum computation in liquid-state nuclear magnetic resonance (NMR) is demonstrated experimentally. Applying specific line-selective pulses with appropriately chosen flipping angles simultaneously and then a field gradient pulse we acquire straightforwardly all pseudo-pure states for two qubits in a single experiment quite efficiently. The signal intensity from the pseudo-pure state prepared in this way is the same as that of temporal averaging. As an example of an application, a highly structured search algorithm – Hogg's algorithm – is also performed on the pseudo-pure state |00 prepared by the method.