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}

\SetKwForand\SetKwIF.