I have written the code for if else if block but I want nested if else if loop like
If (flag)
If (c1) then
c2
Else
If (c3) then
c4
\documentclass{article}
\usepackage[ruled, lined, commentsnumbered, longend]{algorithm2e}
\begin{document}
\begin{algorithm}
\If{(flag)}{
\uIf{c1\;}{c2\;}
\uElse{
\uIf{c3\;}
{ c4\;}
}}
\end{algorithm}
\end{document}

