Both primary storage (RAM and ROM) and Secondary storage (hard and floppy disk drives, Removable drives, CD-ROM and data tape) can store program code.
Any primary or secondary storage except those that are read-only can store data. Typically user data is stored in RAM, or on the hard disk, or on a floppy disk. Since RAM is temporary storage while the PC has power, the hard disk or floppy disk is used to store a permanent copy of the user data.