<?xml version="1.0" encoding='utf-8'?>
<!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN" "http://www.wapforum.org/DTD/wml_1.1.xml">
<wml>
<card id="card1" title="Loop (statement) - Page 11 - Wikipedia">
<p>
<a accesskey="1" href="page.php?w=Loop_(statement)&amp;p=10">1.Previous</a><br />
<a accesskey="3" href="page.php?w=Loop_%28statement%29&amp;p=12">3.Next</a>
</p>
<p>The following C code is an example of a three part loop that prints the numbers from 0 to 4.</p>

<p><syntaxhighlight Lang="c">for (int i = 0; i < 5; i++) {    printf("%d\n", i);}</syntaxhighlight></></syntaxhighlight></p>

<p><big>Equivalent constructs</big></p>
<p>Assuming there is a properly declared function or method called <code>do_work()</code>, the following are equivalent in programming languages which support post-test loops.</p>

<p>Furthermore, given that a <code>continue</code> statement is not used, the above is technically equivalent to</p><p>
<a accesskey="1" href="page.php?w=Loop_(statement)&amp;p=10">1.Previous</a><br />
<a accesskey="3" href="page.php?w=Loop_%28statement%29&amp;p=12">3.Next</a>
</p>

<do type="prev" label="Search">
        <go href="search.wml"/>
</do>

</card>
</wml>
