There is no such thing as a bootable program. You'll have to create a small OS that boots, and then writes "Hello World" to the screen. At that point it's not really C or C++, it's in assembly since that's all the hardware can understand until you have a MUCH more complicated OS loaded.
Keep in mind that you'll also have to store your mini OS/program on the MBR of the PCs main drive since that's where most PC BIOS's are hardwired to look for an OS unless it's specifically configured.
And I have to ask. What the heck do you want something like this for???