A virus is a malicious program that self-replicates by duplicating itself into another program. In other words, the computer virus spreads by itself into other executable code or documents. The purpose of creating a computer virus is to infect vulnerable …