They aren't just accidents that happen to your computer, either. Programmers with specific skills develop them and find ways to spread them to unsuspecting users like yourself. They're malicious programs designed to cause deliberate destruction to your computer. A virus is a piece of code that's loaded onto your computer without your knowledge and runs against your wishes. It is intentionally designed to associate itself with another computer program, so that when the original program is run, the virus program will run as well.
Most viruses can replicate by attaching themselves to other programs.
A simple virus can make a copy of itself over and over again. There are also other virus-like programs. Some people distinguish between general viruses and worms . A worm can replicate itself and use memory, but can't attach itself to other programs. It copies itself to and from floppy disks or across network connections.