I want to reference to a line where a for/while-loop starts. However, with the normal \label command I cannot set a label in the respective line. How else can I reference to the beginning of, e.g., a while-loop? In particular for the example below, how can I create a reference for lines 2-6?
\usepackage[linesnumbered]{algorithm2e}
\begin{document}
Reference to Lines \ref{alg:taskA}-\ref{alg:taskC}. How do I achieve a reference to lines 2-6?
\vspace{2em}
\begin{algorithm}[H]
\KwData{some data}
\KwResult{some result}
initialization\;
\While{termination condition not satisfied}{
Do task A\label{alg:taskA}\\
Do task B\label{alg:taskB}\\
Do task C\label{alg:taskC}\\
}
\end{algorithm}
\end{document}

