# How to write code as normal text?

I got an assignment where i have to explain some code and to do that i have to show my code as normal text. I have no idea how to show my code so is there anyone that could show me how it's done?

\begin{enumerate}
\item test.
\item test.
\item test.
\end{enumerate}

• Welcome to TeX.SE...Can you elaborate your requirement? Like posting screenshot, etc... – MadyYuvi Oct 11 '19 at 11:55
• Only the code? Not also the results like here or here? – Fran Oct 11 '19 at 18:55

Try with \verbatim:

\documentclass{book}

\begin{document}

\begin{verbatim}
\begin{enumerate}
\item test.
\item test.
\item test.
\end{enumerate}
\end{verbatim}

\end{document}


You can also do it with \listings

\documentclass{article}

\usepackage{listings}

\begin{document}

\begin{lstlisting}
\begin{enumerate}
\item test.
\item test.
\item test.
\end{enumerate}
\end{lstlisting}

\end{document}