In HTML <pre> element defines preserve and it does not escape extra spaces or lines, it print them in same format as were written.
<pre></pre>is a pair tag
Any number of spaces and lines can be added, like if you give two new lines and some extra space, it will add two lines and some extra space.
<pre> Content </pre>
You can see the output of first and second example is same as were written in editor.
<pre></pre>
tag has solved many problems related to code writting, poem writting etc.
There is no need of using <br /> element for every single line while displaying code or poem in a web page.
Open notepad or any other text editor, follow the following points.
I am paragraph
I am paragraph 2
save file with name task.html or task.htm and then open it using any browser and see results.
Do not use <br /> element for new line or break line, give new line by putting cursor between I am
and paragraph
and then press enter button and so on.