How do I cause a line break when writing code in latex with predetermined line numbers?

I currently have my pdf looking like this but I want lines 30 and 31 to be green as well. I was wondering if someone knows of a way I can do this?

Here is my Latex

    \begin{enumerate}
\item [\textbf{Example 1:}]
\begin{lstlisting}[firstnumber=1]
int digitOfPi(int n){
/*
* Code not shown
\end{lstlisting}
~~$\vdots$\\
\begin{lstlisting}[firstnumber=30]
*/
}
\end{lstlisting}

• Welcome! Please complete your example so it can be compiled. That will be much more useful than a mere fragment. – cfr Aug 4 '17 at 3:05

The following example provides a workaround for this case. It adds a line comment starting with * to format the ending comment marker as comment. The closing curly brace is left untouched, because it does not belong to the comment.

\documentclass{article}
\usepackage{listings}
\usepackage{xcolor}
\colorlet{darkgreen}{green!70!black}
\lstset{
basicstyle=\ttfamily,
identifierstyle=\color{blue},
numbers=left,
}

\begin{document}
\begin{enumerate}
\item [\textbf{Example 1:}] \mbox{}\\
\begin{lstlisting}[language=C, firstnumber=1]
int digitOfPi(int n) {
/*
* Code not shown
\end{lstlisting}
\vspace{-3ex}
\begin{lstlisting}[mathescape, numbers=none]
$\vdots$
\end{lstlisting}
\vspace{-2ex}
\begin{lstlisting}[language=C, firstnumber=30, morecomment={[l]{*}}]
*/
}
\end{lstlisting}
\end{enumerate}
\end{document}