# How to write this algorithm in latex?

I use the following code for my project I can't write it

for j = l :n
if j > 1
A(j:n,j) = A(j:n, j) - A(j:n, l :j - l )·A(j, l:j - l )T
end
A(j:n, j) = A(j:n, j) / J A(j,j)
end


I use the package for this

\usepackage[ruled,vlined]{algorithm2e}
\usepackage{algorithmic}


I tried to write but I didn't find any solution please help : I sovle it :)

• You need to check the documentation of algorithm2e which is very helpful. Also, your code doesn't stand as a minimal working example. – Diaa Jan 26 at 17:16

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

% https://tex.stackexchange.com/a/362194/2288
\SetKwFor{For}{for }{}{end}

\begin{document}
\begin{algorithm}
\For{j = l :n}{
\If{j > 1}{
A(j:n,j) = A(j:n, j) - A(j:n, l :j - l )·A(j, l:j - l )T
}
A(j:n, j) = A(j:n, j) / J A(j,j)
}
\end{algorithm}
\end{document}