I am writing a LaTeX document for some pseudo code I have written. I have a bunch of while loops, but the way latex is formatting them, it looks like:
while(x)
while(y)
while(z)
whereas I want it to do:
while(x)
while(y)
while(z)
so I tried using \endwhile
, and got the following error:
Undefined control sequence.
l.44 \ENDWHILE
I am using
\usepackage{algorithm}
\usepackage{program}
after using wikibooks – Algorithms & Pseudocode site, in which they use \endwhile
, so I am wondering what I am doing wrong.
Best Answer
Uhm, you actually only need one of those packages. Pick either one, and it should work.
Example for
algorithmic
:Example for
program
: