<?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>break and continue statement in c - Wikitechy</title>
	<atom:link href="https://www.wikitechy.com/interview-questions/tag/break-and-continue-statement-in-c/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.wikitechy.com/interview-questions/tag/break-and-continue-statement-in-c/</link>
	<description>Interview Questions</description>
	<lastBuildDate>Fri, 07 Oct 2022 05:37:01 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.4</generator>

<image>
	<url>https://www.wikitechy.com/interview-questions/wp-content/uploads/2025/10/cropped-wikitechy-icon-32x32.png</url>
	<title>break and continue statement in c - Wikitechy</title>
	<link>https://www.wikitechy.com/interview-questions/tag/break-and-continue-statement-in-c/</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>Explain break and continue statements with examples</title>
		<link>https://www.wikitechy.com/interview-questions/c/explain-break-and-continue-statements-with-examples/</link>
					<comments>https://www.wikitechy.com/interview-questions/c/explain-break-and-continue-statements-with-examples/#respond</comments>
		
		<dc:creator><![CDATA[webmaster]]></dc:creator>
		<pubDate>Fri, 07 Oct 2022 05:35:57 +0000</pubDate>
				<category><![CDATA[C]]></category>
		<category><![CDATA[break and continue in c programming]]></category>
		<category><![CDATA[break and continue statement in c]]></category>
		<category><![CDATA[break statement in c example]]></category>
		<category><![CDATA[break vs continue in c]]></category>
		<category><![CDATA[c break and continue]]></category>
		<category><![CDATA[c break and continue with examples]]></category>
		<category><![CDATA[c programming break and continue statements]]></category>
		<category><![CDATA[continue statement in c example]]></category>
		<category><![CDATA[difference between break and continue statement in c]]></category>
		<category><![CDATA[difference between break and continue statements in c]]></category>
		<guid isPermaLink="false">https://www.wikitechy.com/interview-questions/?p=4947</guid>

					<description><![CDATA[Break This statement is used with switch statement. Can also be used with while loop, do – while loop and for loop. When the control encounters a break statement, the control will terminate the loop immediately and the statements after break will not be executed. Syntax Sample Code Output Continue This statement is used to [&#8230;]]]></description>
										<content:encoded><![CDATA[<h2 id="break" style="text-align: justify;"><strong>Break</strong></h2>
<ul style="text-align: justify;">
<li>This statement is used with switch statement.</li>
<li>Can also be used with while loop, do – while loop and for loop.</li>
<li>When the control encounters a break statement, the control will terminate the loop immediately and the statements after break will not be executed.</li>
</ul>
<h3 id="syntax" style="text-align: justify;">Syntax</h3>
<p style="text-align: justify;"><img fetchpriority="high" decoding="async" class="alignnone size-full wp-image-4948 aligncenter" src="https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/10/c-break-statement.jpg" alt="" width="529" height="346" srcset="https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/10/c-break-statement.jpg 529w, https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/10/c-break-statement-300x196.jpg 300w, https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/10/c-break-statement-390x255.jpg 390w" sizes="(max-width: 529px) 100vw, 529px" /></p>
<h3 id="sample-code" style="text-align: justify;">Sample Code</h3>
<div class="code-embed-wrapper"> <div class="code-embed-infos"> </div> <pre class="language-c code-embed-pre line-numbers"  data-start="1" data-line-offset="0"><code class="language-c code-embed-code">#include&lt;stdio.h&gt;<br/>int main()<br/>{<br/>  <br/>    int i = 0 , j = 0;<br/>  <br/>    // Iterate a loop over the<br/>    // range [0, 5]<br/>     for(int i = 0 ; i &lt; 5 ; i ++)<br/>    {<br/>          printf(“i = %d, j = “, i);<br/>  <br/>        // Iterate a loop over the<br/>        // range [0, 5]<br/>        for(int j = 0 ; j &lt; 5 ; J ++){<br/>  <br/>            // Usage of Break statement<br/>             If ( j == 2)<br/>            <br/>                break;<br/>             printf(“%d “, j);<br/>                    }<br/>  <br/>        printf(&quot;\n&quot;);<br/>    }<br/>  <br/>    return 0;<br/>}</code></pre> </div>
<h3 id="output" style="text-align: justify;">Output</h3>
<p style="text-align: justify;"><img decoding="async" class="alignnone size-full wp-image-4949 aligncenter" src="https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/10/break-statement-in-c.jpg" alt="" width="146" height="164" /></p>
<h2 id="continue" style="text-align: justify;"><strong>Continue</strong></h2>
<ul style="text-align: justify;">
<li>This statement is used to bring the control to the beginning of the loop.</li>
<li>The continue statement skips some lines of code inside the loop and continues with the next iteration.</li>
<li>It is mainly used in a program for skiiping certain condition.</li>
<li>This statement does not exit from the loop of the body.</li>
<li>It is not used to exit from the loop body.</li>
<li>Continue statement is not used with switch statement.</li>
<li>It can be used only with while, do while and for loop.</li>
<li>When the control encounters continue statement,control automatically executes the remaining statements of the loop body.</li>
</ul>
<h3 id="syntax-2" style="text-align: justify;">Syntax</h3>
<p style="text-align: justify;"><img decoding="async" class="alignnone size-full wp-image-4950 aligncenter" src="https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/10/difference-between-break-and-continue.jpg" alt="" width="559" height="325" srcset="https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/10/difference-between-break-and-continue.jpg 559w, https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/10/difference-between-break-and-continue-300x174.jpg 300w, https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/10/difference-between-break-and-continue-390x227.jpg 390w" sizes="(max-width: 559px) 100vw, 559px" /></p>
<h3 id="sample-code-2" style="text-align: justify;">Sample Code</h3>
<div class="code-embed-wrapper"> <div class="code-embed-infos"> </div> <pre class="language-c code-embed-pre line-numbers"  data-start="1" data-line-offset="0"><code class="language-c code-embed-code">#include &lt;stdio.h&gt;<br/>  <br/>// Driver Code<br/>int main()<br/>{<br/>      Int i = 0 , j = 0 ;<br/>  <br/>    // Iterate the loop over the range[0,5]<br/>    for (int i = 0; i &lt; 5; i++) {<br/>         printf(“i = %d, j = “, i);<br/>        // Iterate the loop over the range[0,5]<br/>        For(int j = 0; j &lt; 5 ; j++){  <br/>         // Usage of Continue Statement<br/>            if (j == 2)<br/>                continue;<br/>              printf(&quot;%d &quot;, j);<br/>        }<br/>            printf(“\n”);<br/>            }<br/>  <br/>    return 0;<br/>}</code></pre> </div>
<h3 id="output-2" style="text-align: justify;">Output</h3>
<p style="text-align: justify;"><img loading="lazy" decoding="async" class="alignnone size-full wp-image-4951 aligncenter" src="https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/10/c-continue-statement.jpg" alt="" width="192" height="160" /></p>
<p style="text-align: justify;">
]]></content:encoded>
					
					<wfw:commentRss>https://www.wikitechy.com/interview-questions/c/explain-break-and-continue-statements-with-examples/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>What is the purpose of break and continue statement ?</title>
		<link>https://www.wikitechy.com/interview-questions/php/what-is-the-purpose-of-break-and-continue-statement/</link>
					<comments>https://www.wikitechy.com/interview-questions/php/what-is-the-purpose-of-break-and-continue-statement/#respond</comments>
		
		<dc:creator><![CDATA[webmaster]]></dc:creator>
		<pubDate>Thu, 04 Aug 2022 07:01:21 +0000</pubDate>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[break and continue statement in c]]></category>
		<category><![CDATA[break and continue statement in php]]></category>
		<category><![CDATA[difference between break and continue in c]]></category>
		<category><![CDATA[difference between break and continue in php]]></category>
		<category><![CDATA[difference between break and continue in python]]></category>
		<category><![CDATA[difference between break and continue statement]]></category>
		<category><![CDATA[difference between break and continue statement in php]]></category>
		<category><![CDATA[explain break and continue statement in c]]></category>
		<category><![CDATA[what is break statement in c]]></category>
		<category><![CDATA[what is break statement in php]]></category>
		<category><![CDATA[what is the purpose of break and continue statement]]></category>
		<category><![CDATA[what is the purpose of break and continue statement in php]]></category>
		<category><![CDATA[what is the purpose of using break and continue statements]]></category>
		<category><![CDATA[what is the significance of break and continue statements]]></category>
		<category><![CDATA[what is the use of break and continue statement]]></category>
		<guid isPermaLink="false">https://www.wikitechy.com/interview-questions/?p=4585</guid>

					<description><![CDATA[PHP also has two keywords break and continue to control the loop, just like another programming language. Those statements are known as the flow of transfer or jumping statements in the program. Break The break statement is used inside the for loop, foreach loop, while loop and do-while loop and then switch case statement. Inside [&#8230;]]]></description>
										<content:encoded><![CDATA[<ul style="text-align: justify;">
<li>PHP also has two keywords break and continue to control the loop, just like another programming language.</li>
<li>Those statements are known as the flow of transfer or jumping statements in the program.</li>
</ul>
<h2 id="break" style="text-align: justify;">Break</h2>
<p style="text-align: center;"><img loading="lazy" decoding="async" class="alignnone size-full wp-image-4586" src="https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/08/break-statement.png" alt="" width="991" height="797" srcset="https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/08/break-statement.png 991w, https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/08/break-statement-300x241.png 300w, https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/08/break-statement-768x618.png 768w, https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/08/break-statement-390x314.png 390w, https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/08/break-statement-820x659.png 820w" sizes="(max-width: 991px) 100vw, 991px" /></p>
<ul style="text-align: justify;">
<li>The break statement is used inside the for loop, foreach loop, while loop and do-while loop and then switch case statement.</li>
<li>Inside a loop the break statement encountered then it immediately terminated the loop statement and transferred the control to the next statement, followed by a loop to resume the execution.</li>
<li>In nested loop statement it is also used, where it breaks the inner loop first and then proceed to break the outer loop.</li>
<li>In program it is also used in the switch case statement to terminate a particular case’s execution.</li>
<li>A break statement is placed inside the loop with a condition and then if the condition is true, a break statement is immediately executed to break the execution of the loop and to move the control to the next statement followed by the loop.</li>
</ul>
<h2 id="sample-code" style="text-align: justify;">Sample Code</h2>
<div class="code-embed-wrapper"> <div class="code-embed-infos"> </div> <pre class="language-php code-embed-pre line-numbers"  data-start="1" data-line-offset="0"><code class="language-php code-embed-code">&lt;?php    <br/><br/>// defines the for loop   <br/><br/>for ($a = 0; $a &lt; 10; $a++) {  <br/><br/>  if ($a == 7) {  <br/><br/>    break; /* Break the loop when condition is true. */  <br/><br/>  }  <br/><br/>  echo &quot;Number: $a &lt;br&gt;&quot;;  <br/><br/>}  <br/><br/>echo &quot; Terminate the loop at $a number&quot;;  <br/><br/>?&gt;  </code></pre> </div>
<h2 id="output" style="text-align: justify;">Output</h2>
<p><img loading="lazy" decoding="async" class="alignnone size-full wp-image-4587 aligncenter" src="https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/08/break-statement-output.png" alt="" width="1341" height="542" srcset="https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/08/break-statement-output.png 1341w, https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/08/break-statement-output-300x121.png 300w, https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/08/break-statement-output-1024x414.png 1024w, https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/08/break-statement-output-768x310.png 768w, https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/08/break-statement-output-390x158.png 390w, https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/08/break-statement-output-820x331.png 820w, https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/08/break-statement-output-1180x477.png 1180w" sizes="(max-width: 1341px) 100vw, 1341px" /></p>
<h2 id="continue" style="text-align: justify;">Continue</h2>
<p style="text-align: center;"><img loading="lazy" decoding="async" class="alignnone size-full wp-image-4588" src="https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/08/continue-statement.png" alt="" width="861" height="802" srcset="https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/08/continue-statement.png 861w, https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/08/continue-statement-300x279.png 300w, https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/08/continue-statement-768x715.png 768w, https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/08/continue-statement-390x363.png 390w, https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/08/continue-statement-820x764.png 820w" sizes="(max-width: 861px) 100vw, 861px" /></p>
<ul style="text-align: justify;">
<li>It is used in the middle of for loop, while loop, do-while loop and for-each loop.</li>
<li>In a loop the continue statement is encountered then it skips the current iteration of the loop.</li>
<li>A continue statement is usually used with a condition inside a loop and then if the condition is true, the continue statement is executed to skip the iteration.</li>
<li>It transfers the control to the beginning of the loop for further execution inside the loop, after that.</li>
</ul>
<h2 id="sample-code-2" style="text-align: justify;">Sample Code</h2>
<div class="code-embed-wrapper"> <div class="code-embed-infos"> </div> <pre class="language-php code-embed-pre line-numbers"  data-start="1" data-line-offset="0"><code class="language-php code-embed-code">&lt;?php    <br/><br/>// defines the for loop   <br/><br/>for ($a = 0; $a &lt; 7; $a++) {  <br/><br/>  if ($a == 5) {  <br/><br/>  echo &quot; Skipped number is $a &lt;br&gt;&quot;; // prints the skipped number.  <br/><br/>    continue; /* It skips the defined statement if the condition is true. */  <br/><br/>  <br/><br/>  }  <br/><br/>  echo &quot;Number is: $a &lt;br&gt;&quot;;  <br/><br/>}  <br/><br/>?&gt;</code></pre> </div>
<h2 id="output-2" style="text-align: justify;"> Output</h2>
<p><img loading="lazy" decoding="async" class="alignnone size-full wp-image-4589" src="https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/08/continue-statement-output.png" alt="" width="1329" height="477" srcset="https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/08/continue-statement-output.png 1329w, https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/08/continue-statement-output-300x108.png 300w, https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/08/continue-statement-output-1024x368.png 1024w, https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/08/continue-statement-output-768x276.png 768w, https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/08/continue-statement-output-390x140.png 390w, https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/08/continue-statement-output-820x294.png 820w, https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/08/continue-statement-output-1180x424.png 1180w" sizes="(max-width: 1329px) 100vw, 1329px" /></p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.wikitechy.com/interview-questions/php/what-is-the-purpose-of-break-and-continue-statement/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
