[Tex/LaTex] Pseudo code for this algorithm

algorithms

I am new to LaTeX … I have searched many examples of algo pseudocode for this type of code.I don't know which package to use to write this algorithm.

Please help me with the code.

enter image description here

Best Answer

Here is a simple example with algorithm2e.You can find more about it in the documentation in CTAN.

\documentclass{article}
\usepackage[linesnumbered]{algorithm2e}


\begin{document}
\begin{algorithm}[htb]
\caption{An Algorithm}
\label{alg:algo1}

\KwIn{Some input}
\KwOut{Some Output}

$F_{i}\leftarrow0$\;
Do something\;
\For {$i=1$ \thinspace to 100}{
    Do something one thing\;
    $F_{i}\leftarrow F_{i} + 1$\;
}
\end{algorithm}
\end{document}

algo1

Related Question