What is difference between Virus and Worm?

A computer virus is malware code that can replicate to form self-copies of itself by attaching itself to an application, file or a program, or even to the boot sector of the hard drive. When the infected file is run on the system, the virus starts to replicate itself and spreads the infection to other applications.  

A computer worm is more like a computer virus– as they propagate themselves to spread the infection more quickly within the local network and the system worldwide. However, the worms do not attach to files or application but enters the computer by exploiting a vulnerability.