What is a computer virus?

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.