Computer VirusesA virus is a code written with the express intention that the virus code replicates itself.
A virus spreads itself from computer to computer by attaching itself to a host program. It may damage hardware, software or data.
A worm is a kind of virus that generally spreads without user action and distributes complete copies (possibly modified) of itself across networks. A worm can exhaust memory or network bandwidth, causing a computer to stop responding.
A virus that appears to be a useful program, but that actually does damage, is a "trojan horse."