Computer virus isn’t a virus which you think needs an antibiotic :P, but it’s a small piece of code written which would ensure a good sleep for your computer. Now, I won’t turn towards the history of virus because, we both know that we both hate history returning towards the procedure.

It’s a piece of code as long as 5 characters:
%0|%0
Note : This post is only for educational purpose, and highly recommend you to not to use it as practical not on your own computer neither on any other’s computer.
Procedure to convert this into virus:
Step 1: Open your notepad.
Step 2: Copy this code into your notepad

Step 3: while saving this file, change the encoding to “All files” and change the extension from .txt to .bat

That’s it. You have created a computer virus which would ensure a good sleep on the tested computer.
Note: This post is only for educational purpose, and highly recommend you to not to use it as practical not on your own computer neither on any other’s computer.
Explanation: A virus is a small piece of coding that piggybacks on real programs. For example, a virus might attach itself to a program such as a spreadsheet program. Each time the spreadsheet program runs, the virus runs, too, and it has the chance to reproduce (by attaching to other programs) or wreak havoc.
A virus normally requires an action to infect a victim. For instance, the malicious programs inside e-mail attachments usually only strike if you open them. The effect of a virus can be anything from a simple prank that pops up messages to the complete destruction of programs and data.
In this case, this virus gets in an infinite loop which consumes all of your ram. You can observe this loop while doing a Java coding, when you enter a wrong statement.