Virus: A virus is a program that propagates itself by infecting other programs residing on the computer system.
Viruses are capable of inflicting serious damage to your system, such as erasing your files or your whole disk,
or they may just do lighter things like a pop-up a window with a message.
Worm : A worm can spread itself (without the help of any other program) over the network from one computer
to another. Worms replicate without any user intervention, whereas viruses are known to spread through a user.
The replication is based on a security flaw in the Operation System or any other applications running on a system.
Trojan horse: A general term, referring to programs that appear innocent,
but actually harmful. For example a download that says "birthday greetings" etc. But when you download and
run it, it may do serious damage to your computer system such as damaging important files or even making the computer unusable.
The trojan's contents could also be a virus or worm, which then spread the damage.
Logic bomb: A logic bomb is signified by uniqueness of occurrence. It can be a virus or Trojan horse, but activated on the
occurrence of an event in the future.