If you want to keep your current settings (mdframed+verbatim), you can use the \captionof command from the caption package to obtain a caption. Another option is to use the features provided by the listings package (instead of using mdframed+verbatim) to write your listings; the lstlisting environment gives you the possibility to have a frame and caption for your listings:
\documentclass[a4paper,12pt]{article}
\usepackage{listings}
\usepackage{mdframed}
\usepackage{caption}
\captionsetup[lstlisting]{labelsep=none}
\lstset{frame={tblr}}
\begin{document}
\begin{lstlisting}[caption={\null}]
S = 55; % Value of the underlying
...
V =
2.2147 %This is the value of our put option
\end{lstlisting}
\begin{mdframed}[skipabove=\topsep,skipbelow=\topsep]
\captionof{lstlisting}{}
\begin{verbatim}
S = 55; % Value of the underlying
...
V =
2.2147 %This is the value of our put option
\end{verbatim}
\end{mdframed}
\end{document}

If you want this to apply automatically, you can surround verbatim with a mdframed and use the settings key to automatically generate the caption:
\documentclass[a4paper,12pt]{article}
\usepackage{mdframed}
\usepackage{listings}
\usepackage{caption}
\captionsetup[lstlisting]{labelsep=none}
\surroundwithmdframed[
skipabove=\topsep,
skipbelow=\topsep,
settings=\captionof{lstlisting}{}
]{verbatim}
\begin{document}
\begin{verbatim}
S = 55; % Value of the underlying
...
V =
2.2147 %This is the value of our put option
\end{verbatim}
\begin{verbatim}
S = 55; % Value of the underlying
...
V =
8.2147 %This is the value of our put option
\end{verbatim}
\end{document}

mcodeorlistingspackages instead of usingmdframedandverbatim, see e.g. http://tex.stackexchange.com/questions/53238/putting-in-matlab-codes-in-a-box-as-figures – Torbjørn T. Apr 29 '13 at 13:53matlab-prettifierpackage; see this answer. – jub0bs Apr 28 '14 at 15:53