A computer virus is a malicious software program that can replicate itself and spread from one computer to another. It attaches itself to a legitimate program or file and executes its code when the program or file is run. A computer worm, on the other hand, is a standalone malware program that can self-replicate and spread across a network without needing to attach itself to another program or file.
Both viruses and worms can cause damage to computer systems, but they do so in different ways. Viruses can corrupt or delete files, while worms can clog networks and slow down or even crash computers.