[Tex/LaTex] “While” loop without “do”; “if” statement without “then”

algorithm2ealgorithms

I have a similar question as this “For” loop without “do”; “if” statement without “then”:

How can I get rid of the do in a for loop and the then in an if
statement when typesetting algorithms using the algorithm and
algorithmicx packages?

but I want the same thing for algorithm2e package.

A minimal compilable example:

\documentclass[10pt]{article}
\usepackage[linesnumbered,ruled]{algorithm2e}
\SetKwRepeat{Do}{do}{while}
\SetKw{KwGoTo}{go to}

\begin{document}

\begin{algorithm}
\DontPrintSemicolon
\KwIn{$A,B$}
\KwOut{$C$}
\While{$B > 0$}
{
     $C = C+1$;
     $B = B-1$;
    \uIf{$C > A$}
       {
           \textbf{break}\;
       }
}
\caption{ABC}
\end{algorithm}

\end{document}

Best Answer

\documentclass[10pt]{article}
\usepackage[linesnumbered,ruled]{algorithm2e}
\SetKwIF{If}{ElseIf}{Else}{if}{}{else if}{else}{end if}%
\SetKwFor{While}{while}{}{end while}%
\SetKwRepeat{Do}{do}{while}
\SetKw{KwGoTo}{go to}
\begin{document}
...

enter image description here