<?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>while loop in c++ | Student Projects</title>
	<atom:link href="https://studentprojects.in/tag/while-loop-in-c/feed/" rel="self" type="application/rss+xml" />
	<link>https://studentprojects.in</link>
	<description>Microcontroller projects, Circuit Diagrams, Project Ideas</description>
	<lastBuildDate>Thu, 29 Dec 2022 13:49:33 +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>The While Loop</title>
		<link>https://studentprojects.in/software-development/cpp/the-while-loop/</link>
					<comments>https://studentprojects.in/software-development/cpp/the-while-loop/#respond</comments>
		
		<dc:creator><![CDATA[Shubhajna Rai]]></dc:creator>
		<pubDate>Thu, 29 Dec 2022 00:40:00 +0000</pubDate>
				<category><![CDATA[C++]]></category>
		<category><![CDATA[while loop in c++]]></category>
		<category><![CDATA[illustration of how a while loop]]></category>
		<guid isPermaLink="false">https://studentprojects.in/?p=10045</guid>

					<description><![CDATA[<p>A While loop is also referred to as a pre-tested loop. A while loop in a computer allows a piece of code to be executed several times depending on a given test condition that evaluates to true or false. The while loop is typically used when the number of iterations is unknown. If the number</p>
<p>The post <a href="https://studentprojects.in/software-development/cpp/the-while-loop/">The While Loop</a> first appeared on <a href="https://studentprojects.in">Student Projects</a>.</p>]]></description>
										<content:encoded><![CDATA[<p>A While loop is also referred to as a pre-tested loop. A while loop in a computer allows a piece of code to be executed several times depending on a given test condition that evaluates to true or false. The while loop is typically used when the number of iterations is unknown. If the number of iterations is known, we may alternatively utilise the previously mentioned for loop.</p>



<p>The syntax for utilising a while loop is as follows.</p>



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



<p>A while loop&#8217;s body can include a single statement or a block of statements. The test condition might be any expression that should return true or false. While the test condition is true, the loop iterates. It finishes when the condition turns false.</p>



<p>This is one illustration of how a 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;
    while (i &lt; 10)
    {
        cout &lt;&lt; i &lt;&lt; " ";
        i++;
    }
 
    return 0;
}
</code></pre>



<p>Output:</p>



<p>5 6 7 8 9</p><p>The post <a href="https://studentprojects.in/software-development/cpp/the-while-loop/">The 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/the-while-loop/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
