<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>illustration of how do while loop works | Student Projects</title>
	<atom:link href="https://studentprojects.in/tag/illustration-of-how-do-while-loop-works/feed/" rel="self" type="application/rss+xml" />
	<link>https://studentprojects.in</link>
	<description>Microcontroller projects, Circuit Diagrams, Project Ideas</description>
	<lastBuildDate>Sat, 31 Dec 2022 10:31:34 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.1.7</generator>
	<item>
		<title>Do While Loop</title>
		<link>https://studentprojects.in/software-development/cpp/do-while-loop/</link>
					<comments>https://studentprojects.in/software-development/cpp/do-while-loop/#respond</comments>
		
		<dc:creator><![CDATA[Shubhajna Rai]]></dc:creator>
		<pubDate>Fri, 30 Dec 2022 01:46:00 +0000</pubDate>
				<category><![CDATA[C++]]></category>
		<category><![CDATA[Do while loop in c++]]></category>
		<category><![CDATA[illustration of how do while loop works]]></category>
		<guid isPermaLink="false">https://studentprojects.in/?p=10047</guid>

					<description><![CDATA[<p>A do-while loop differs from a standard while loop. Unlike a while loop, a do-while loop executes the statements within the loop&#8217;s body before checking the test condition. Even if a condition is initially false, the do-while loop will have already executed once. A do-while loop is similar to a while loop, except that the</p>
<p>The post <a href="https://studentprojects.in/software-development/cpp/do-while-loop/">Do While Loop</a> first appeared on <a href="https://studentprojects.in">Student Projects</a>.</p>]]></description>
										<content:encoded><![CDATA[<p>A do-while loop differs from a standard while loop. Unlike a while loop, a do-while loop executes the statements within the loop&#8217;s body before checking the test condition.</p>



<p>Even if a condition is initially false, the do-while loop will have already executed once. A do-while loop is similar to a while loop, except that the body is guaranteed to be executed at least once.</p>



<p>In contrast to for and while loops, which test the loop condition first and then run the code contained inside the loop body, the do-while loop examines its condition at the end of the loop.</p>



<p>Following is the syntax for using a do-while loop.</p>



<pre class="wp-block-code"><code lang="cpp" class="language-cpp">do
{
    statements;
} while (test condition);</code></pre>



<p>The body of the do-while loop is first run once. The test condition is only then evaluated. If the test condition is true, the sequence of instructions within the loop&#8217;s body is repeated, and the test condition is evaluated. The technique is repeated until the test condition becomes false. The loop is terminated if the test condition returns false.</p>



<p>This is one illustration of how a do-while loop works.</p>



<pre class="wp-block-code"><code lang="cpp" class="language-cpp">#include &lt;iostream&gt;
using namespace std;
 
int main()
{
    int i = 5;
    do
    {
        cout &lt;&lt; i &lt;&lt; " ";
        i++;
    } while (i &lt; 5);
 
    return 0;
}
</code></pre>



<p>Output:</p>



<p>5</p>



<p>Even though I was less than 5 from the start, the do-while allowed the print statement to run once before terminating.</p><p>The post <a href="https://studentprojects.in/software-development/cpp/do-while-loop/">Do While Loop</a> first appeared on <a href="https://studentprojects.in">Student Projects</a>.</p>]]></content:encoded>
					
					<wfw:commentRss>https://studentprojects.in/software-development/cpp/do-while-loop/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
