\begin{algorithmic}[1]
\State $i = 10$
\State $r = 0$
\While{$i \neq 0$}
\State $r = r+i$
\State $i = i-1$
\EndWhile
\State \Return $r$
\end{algorithmic}