Usually a broken wire, loose connector or broken pin connecting the monitor to the computer.
Your HP desktop has "onboard" graphics, not a separate graphics card, as your monitor cable is connected to the mother boards I/O panel, right? What cable/interface are you using, the DVI or HDMI? HDMI cables can fit rather loosely, so with the PC off, try reinserting the cable on the PC and monitor. If you are using a VGA cable, you could try other options like the ones I mentioned above, if available. Cables are cheap, if you buy them at the right place, and you don't need a so-called fancy, expensive cable. If changing cables or outputs/inputs does not work, then the connector on the mother board or monitor may have been damaged.