A computer virus is a program(software).Viruses often exploit weaknesses in the security of operating systems or misplaced trust from users.A computer virus attaches itself to a program or file enabling it to spread from one computer to another, leaving infections as it travels.
Almost all viruses are attached to an executable file, which means the virus may exist on your computer but it actually cannot infect your computer unless you run or open the malicious program. It is important to note that a virus cannot be spread without a human action, (such as running an infected program) to keep it going.
The first virus(brain) was developed by Pakistanis in order to tackle copyright problem (1986).
Market of anti virus companies is due to presence of viruses.Viruses are intentionally produced by a group of software engineers of anti virus companies and are spreaded in cyber world by different methods and when they affect the people on large scale the software engineers of antivirus companies create a new version of antivirus this is how antivirus softwares are sold in the market.
But this is not the case always.Some time old programs can become viruses in a way they there are minor coding errors or garbage values which shake your system upside down.The unintentionally viruses are really hard to tackle in cyber world .They have been used as a weapon by hackers and blackmailers.
A worm is similar to a virus by design and is considered to be a sub-class of a virus. Worms spread from computer to computer, but unlike a virus, it has the capability to travel without any human action. A worm takes advantage of file or information transport features on your system, which is what allows it to travel unaided.
A trojan is destructive program that masquerades as a benign application. Unlike viruses, Trojan horses do not replicate themselves.A Trojan Horse is full of as much trickery as the mythological Trojan Horse it was named after. The Trojan Horse, at first glance will appear to be useful software but will actually do damage once installed or run on your computer.Some Trojans are designed to be more annoying than malicious (like changing your desktop, adding silly active desktop icons) or they can cause serious damage by deleting files and destroying information on your system. Trojans are also known to create a backdoor on your computer that gives malicious users access to your system, possibly allowing confidential or personal information to be compromised.