A computer virus is a harmful program that is developed by those who want to cause damage or disruption to systems and computers. They are hidden bits of code that connect to different programs or applications and when activated, spread like wildfire. Typically, viruses can be discovered in a document or program that has been downloaded from the internet or sent via email. The majority of countries believe that spreading and creating a computer virus is illegal.
There are many kinds of computer viruses which can infect machines in different ways. Some depend on a program to start their work and others are self-contained and can infect multiple systems without the need for an host. A computer virus that makes use of a host program to infect computers is usually considered as a worm and those that do not make use of the method used to infect by other programs are believed to be viruses.
Some viruses infect a system immediately upon insertion, while others remain dormant, and only become active when the user executes the code. The first computer virus, created in 1974 and modeled after biological viruses, grew itself quickly and caused damage to the system. Stuxnet is an example of an extremely destructive computer virus. It was designed to destroy computerized centrifuges that were used to enrich the uranium.
It is not for the weak-hearted to attempt this task. However it can be a fun and interesting way to test your skills in computer programming languages and systems. There are many resources that will show you how to create a virus, if you are willing and willing to put into the effort.