yet another stupid compiler
Log | Files | Refs | README | git clone https://git.ne02ptzero.me/git/Y-asc

commit 29f83765e857eb3cedcb03c8f58e86459b70de7e
parent 8a010c4a96d006a7fb07a1dad87e61509f00d19f
Author: Ne02ptzero <louis@ne02ptzero.me>
Date:   Fri, 30 Jun 2017 11:50:01 +0200

Add(Tex): Section about do-while

Mtex/yasc.tex | 14++++++++++++++
1 file changed, 14 insertions(+), 0 deletions(-)

diff --git a/tex/yasc.tex b/tex/yasc.tex @@ -577,6 +577,20 @@ Operators & Associativity\\ print("Letter position %d is %c\n", i, str[i]); \end{lstlisting} \subsection{Loops - Do-While} + As we discussed earlier, the \texttt{while} and \texttt{for} loops + test the termination condition at the top. By contrast, the \texttt{do-while} + loop tests at the bottom \texttt{after} making each pass through the + loop body; the body is always executed at least once. + + The syntax of the \texttt{do} is + \begin{lstlisting} + do + statement; + while (expression); + \end{lstlisting} + The \texttt{statement} is executed, then \texttt{expression} is + evaluated. If it is true, \texttt{statement} is evaluated again, and so on. + When the expression becomes false, the loop terminates. \subsection{Break and Continue} \label{break_n_continue} \section{Functions and Program Structure} \subsection{Basics}