I am using TEXMAKER. Here is a code segment.
\usepackage{algorithmic}
begin{algorithmic}
\FOR {$i\gets0$ to $n$} \do
\FOR {$j \gets$0 \TO $min(i,k)$} \do
\IF {$j=0$ \OR $j=i$}
\STATE $C[i,j] \gets 1$
\ELSE
\STATE $C[i,j] \gets C[i-1,j-1]+C[i-1,j]$
\ENDIF
\ENDFOR
\ENDFOR
\RETURN C[n,k]
\end{algorithmic}
Best Answer
Remove the
\do
s, and this works fine. As a side note, use$\min(i,k)$
instead of$min(i,k)$
, and (as egreg mentioned in a comment) there is a pair of$
missing from the last line of the algorithm.