A computer virus is a kind of malevolent software or a piece of code that, when executed, is capable of copying itself and typically has a detrimental effect, such as corrupting the system or destroying data. When this replication succeeds, the areas are then said to be “infected” with a computer virus.