<?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>for loop in c programming example - Wikitechy</title>
	<atom:link href="https://www.wikitechy.com/interview-questions/tag/for-loop-in-c-programming-example/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.wikitechy.com/interview-questions/tag/for-loop-in-c-programming-example/</link>
	<description>Interview Questions</description>
	<lastBuildDate>Mon, 03 Oct 2022 11:52:50 +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>for loop in c programming example - Wikitechy</title>
	<link>https://www.wikitechy.com/interview-questions/tag/for-loop-in-c-programming-example/</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>What is While Loop in C Language with example ?</title>
		<link>https://www.wikitechy.com/interview-questions/c/what-is-while-loop-in-c-language-with-example/</link>
					<comments>https://www.wikitechy.com/interview-questions/c/what-is-while-loop-in-c-language-with-example/#respond</comments>
		
		<dc:creator><![CDATA[webmaster]]></dc:creator>
		<pubDate>Mon, 03 Oct 2022 11:52:50 +0000</pubDate>
				<category><![CDATA[C]]></category>
		<category><![CDATA[c while and do..while loop]]></category>
		<category><![CDATA[c while loop]]></category>
		<category><![CDATA[do while loop example]]></category>
		<category><![CDATA[do-while loop in c programming examples]]></category>
		<category><![CDATA[for loop in c programming example]]></category>
		<category><![CDATA[for loop in c programming examples]]></category>
		<category><![CDATA[while loop example]]></category>
		<category><![CDATA[while loop in c]]></category>
		<category><![CDATA[while loop in c language with examples]]></category>
		<category><![CDATA[while loop in c programming example]]></category>
		<category><![CDATA[while loop in c programming with example]]></category>
		<category><![CDATA[while loop syntax]]></category>
		<guid isPermaLink="false">https://www.wikitechy.com/interview-questions/?p=4928</guid>

					<description><![CDATA[While loop evaluates the conditions inside the brackets. If the condition returns true, the statements inside the while loop body will be executed. Condition inside the while loop is executed once again. This process goes on until the condition in the while loop becomes false. Once the condition is false, while loop terminates. Syntax of [&#8230;]]]></description>
										<content:encoded><![CDATA[<ul>
<li>While loop evaluates the conditions inside the brackets.</li>
<li>If the condition returns true, the statements inside the while loop body will be executed.</li>
<li>Condition inside the while loop is executed once again.</li>
<li>This process goes on until the condition in the while loop becomes false.</li>
<li>Once the condition is false, while loop terminates.</li>
</ul>
<p><img fetchpriority="high" decoding="async" class="alignnone size-full wp-image-4929 aligncenter" src="https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/10/while-loop-in-c.jpg" alt="" width="331" height="341" srcset="https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/10/while-loop-in-c.jpg 331w, https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/10/while-loop-in-c-291x300.jpg 291w" sizes="(max-width: 331px) 100vw, 331px" /></p>
<h2 id="syntax-of-while-loop">Syntax of While loop</h2>
<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">while (testExpression) {<br/>  // the body of the loop <br/>}</code></pre> </div>
<h2 id="sample-code">Sample Code</h2>
<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">// Print numbers from 1 to 5<br/><br/>#include &lt;stdio.h&gt;<br/>int main() {<br/>  int i = 1;<br/>    <br/>  while (i &lt;= 5) {<br/>    printf(&quot;%d\n&quot;, i);<br/>    ++i;<br/>  }<br/><br/>  return 0;<br/>}</code></pre> </div>
<h2 id="output">Output</h2>
<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">1<br/>2<br/>3<br/>4<br/>5</code></pre> </div>
<p>&nbsp;</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.wikitechy.com/interview-questions/c/what-is-while-loop-in-c-language-with-example/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>main () {int x=20, y=35; x = y++ + x++; y = ++y + ++x; printf (&#8220;%d %d\n”, x, y);} ?</title>
		<link>https://www.wikitechy.com/interview-questions/c/main-int-x20-y35-x-y-x-y-y-x-printf-d-dn-x-y/</link>
					<comments>https://www.wikitechy.com/interview-questions/c/main-int-x20-y35-x-y-x-y-y-x-printf-d-dn-x-y/#respond</comments>
		
		<dc:creator><![CDATA[Editor]]></dc:creator>
		<pubDate>Mon, 12 Jul 2021 19:55:57 +0000</pubDate>
				<category><![CDATA[C]]></category>
		<category><![CDATA[A Simple C Program for Mathematical Calculation]]></category>
		<category><![CDATA[Accentur interview questions and answers]]></category>
		<category><![CDATA[Applied Materials interview questions and answers]]></category>
		<category><![CDATA[Asian Paints Ltd. interview questions and answers]]></category>
		<category><![CDATA[Basics of Common Math Functions in C Programming]]></category>
		<category><![CDATA[Bosch India Software interview questions and answers]]></category>
		<category><![CDATA[C Programming Examples on Mathematical Functions]]></category>
		<category><![CDATA[c programming math functions]]></category>
		<category><![CDATA[c programming math operators]]></category>
		<category><![CDATA[C/C++ Mathematical Programs]]></category>
		<category><![CDATA[c++ math code examples]]></category>
		<category><![CDATA[c++ programs mathematical formula]]></category>
		<category><![CDATA[Capgemini interview questions and answers]]></category>
		<category><![CDATA[CASTING NETWORKS INDIA PVT LIMITED interview questions and answers]]></category>
		<category><![CDATA[CGI Group Inc interview questions and answers]]></category>
		<category><![CDATA[Chetu interview questions and answers]]></category>
		<category><![CDATA[Ciena Corporation interview questions and answers]]></category>
		<category><![CDATA[Collabera Technologies interview questions and answers]]></category>
		<category><![CDATA[computer programming formulas]]></category>
		<category><![CDATA[define main() in c language]]></category>
		<category><![CDATA[Dell International Services India Pvt Ltd interview questions and answers]]></category>
		<category><![CDATA[DHFL Pramerica Life Insurance Company Ltd interview questions and answers]]></category>
		<category><![CDATA[Elico HealthCare Services Ltd interview questions and answers]]></category>
		<category><![CDATA[explain the importance of main function in c]]></category>
		<category><![CDATA[Flipkart interview questions and answers]]></category>
		<category><![CDATA[for loop in c programming example]]></category>
		<category><![CDATA[HCL Technol interview questions and answers]]></category>
		<category><![CDATA[IBM interview questions and answers]]></category>
		<category><![CDATA[importance of main function in c++]]></category>
		<category><![CDATA[Indecomm Global Services interview questions and answers]]></category>
		<category><![CDATA[main function c programming]]></category>
		<category><![CDATA[main function in c is user defined or not]]></category>
		<category><![CDATA[main in c programming]]></category>
		<category><![CDATA[main method in c]]></category>
		<category><![CDATA[main() function definition]]></category>
		<category><![CDATA[math functions in c programming examples]]></category>
		<category><![CDATA[mathematical programming in c]]></category>
		<category><![CDATA[Mathematical Programs in C Langauge]]></category>
		<category><![CDATA[mathematical programs in c language]]></category>
		<category><![CDATA[mathematics in c programming]]></category>
		<category><![CDATA[Mavenir interview questions and answers]]></category>
		<category><![CDATA[Mphasis interview questions and answers]]></category>
		<category><![CDATA[NetApp interview questions and answers]]></category>
		<category><![CDATA[Oracle Corporation interview questions and answers]]></category>
		<category><![CDATA[PeopleStrong interview questions and answers]]></category>
		<category><![CDATA[R Systems interview questions and answers]]></category>
		<category><![CDATA[Raqmiyat Information Technologies Pvt Ltd interview questions and answers]]></category>
		<category><![CDATA[Reliance Industries Ltd interview questions and answers]]></category>
		<category><![CDATA[SAP Labs India Pvt Ltd interview questions and answers]]></category>
		<category><![CDATA[syntax of function in c]]></category>
		<category><![CDATA[Tata AIA Life Insurance interview questions and answers]]></category>
		<category><![CDATA[Tech Mahindr interview questions and answers]]></category>
		<category><![CDATA[The Linde Group interview questions and answers]]></category>
		<category><![CDATA[what does main() mean in c]]></category>
		<category><![CDATA[what is main function in c++]]></category>
		<category><![CDATA[what is main() function]]></category>
		<category><![CDATA[what is main() in c++]]></category>
		<category><![CDATA[what is the main function]]></category>
		<category><![CDATA[what is the purpose of main function in c language]]></category>
		<category><![CDATA[zencer interview questions and answers]]></category>
		<guid isPermaLink="false">https://www.wikitechy.com/interview-questions/?p=313</guid>

					<description><![CDATA[Answer : While calculating the y value, x &#038; y values are preincremtned, so x &#038; y values are incremented...]]></description>
										<content:encoded><![CDATA[<div class="TextHeading">
<div class="hddn">
<h2 id="find-the-output-of-c-program" class="color-purple" style="text-align: justify;">Find the output of C Program ?</h2>
</div>
</div>
<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">main()<br/>{<br/>int x=20,y=35;<br/>x = y++ + x++;<br/>y = ++y + ++x;<br/>printf(&quot;%d %d\n&quot;,x,y);<br/>} ? </code></pre> </div>
<p style="text-align: justify;">While calculating the x value, x &amp; y values are post incremented. So, the values of x &amp; y are added and then incremented i.e. x=56, y=36</p>
<p style="text-align: justify;">While calculating the y value, x &amp; y values are preincremented, so x &amp; y values are incremented and then added i.e x=57, y=37.</p>
<p style="text-align: justify;"><b>{ x=y++ + x++; }</b> equal to</p>
<div class="CodeContent" style="text-align: justify;">
<div class="hddn">
<figure class="highlight"><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"><br/>x=y+x;//35+20<br/>x++; //56<br/>y++; //36<br/>}</code></pre> </div></figure>
</div>
</div>
<p style="text-align: justify;"><b>y=++y + ++x;</b> is equal to</p>
<div class="CodeContent" style="text-align: justify;">
<div class="hddn">
<figure class="highlight"><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"><br/>++y;//37<br/>++x;//57<br/>y=y+x;//37+57<br/>}</code></pre> </div></figure>
</div>
</div>
<p style="text-align: justify;"><b>Output:</b></p>
<div class="Output" style="text-align: justify;">
<div class="hddn">
<figure class="highlight"><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">x=57<br/> y=94</code></pre> </div></figure>
</div>
</div>
]]></content:encoded>
					
					<wfw:commentRss>https://www.wikitechy.com/interview-questions/c/main-int-x20-y35-x-y-x-y-y-x-printf-d-dn-x-y/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
