A computer virus is a type of malicious software that is designed to spread from one computer to another and…