is a man-made program (small bits of programming code disguised as something else or buried in other codes) that causes an unexpected and usually undesirable event. A virus can replicate itself and is designed to automatically spread to other computer users. Viruses can be transmitted through email attachments, downloads or removable media such as CDs, DVDs, or USB drives. Depending on the maliciousness and skill of the virus creator, the damage caused by a virus will vary. Some viruses will spread its viral code into other programs, corrupt, modify or even erase files. Some viruses wreak their effect as soon as their code is executed while other viruses lie dormant until circumstances cause their code to be executed by the computer. Viruses are usually classified by various criteria to include origin, techniques, types of files they infect, where they hide, kind of damage they cause, etc.
To fully understand what a virus does, you need to understand there are many other types of malware and that they differ from each other.