A virus is a piece of code that uses a computer's resources to spread and replicate. The replication occurs without the user's knowledge.
Different viruses have different ways of infecting a computer or floppy disk.
Infection can occur if you start your computer from an already infected disk, use an infected file or application on your computer, or use your disk in an infected computer that then spreads the infection to your disk. The most common type of virus currently is the macro virus. The second most common is the boot sector infector. Other common viruses that infect applications are called file infectors. Most viruses now prevalent are one of these types or are a combination of them.