<?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>syntax of if else statement | Student Projects</title>
	<atom:link href="https://studentprojects.in/tag/syntax-of-if-else-statement/feed/" rel="self" type="application/rss+xml" />
	<link>https://studentprojects.in</link>
	<description>Microcontroller projects, Circuit Diagrams, Project Ideas</description>
	<lastBuildDate>Sat, 10 Dec 2022 04:24:17 +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>C if&#8230;else statements</title>
		<link>https://studentprojects.in/software-development/c-tutorials/c-tutorials-c-tutorials/c-if-else-statements/</link>
					<comments>https://studentprojects.in/software-development/c-tutorials/c-tutorials-c-tutorials/c-if-else-statements/#respond</comments>
		
		<dc:creator><![CDATA[Shubhajna Rai]]></dc:creator>
		<pubDate>Tue, 25 Oct 2022 08:00:55 +0000</pubDate>
				<category><![CDATA[C Tutorials]]></category>
		<category><![CDATA[if else statement]]></category>
		<category><![CDATA[syntax of if else statement]]></category>
		<guid isPermaLink="false">https://studentprojects.in/?p=9669</guid>

					<description><![CDATA[<p>Sometimes, we want to carry out one set of instructions only when a certain condition is satisfied, and another set only when that condition is not. A decision control system is used in C to handle situations of this nature. The decision control instruction is implemented in C using the if keyword, just like in</p>
<p>The post <a href="https://studentprojects.in/software-development/c-tutorials/c-tutorials-c-tutorials/c-if-else-statements/">C if…else statements</a> first appeared on <a href="https://studentprojects.in">Student Projects</a>.</p>]]></description>
										<content:encoded><![CDATA[<p>Sometimes, we want to carry out one set of instructions only when a certain condition is satisfied, and another set only when that condition is not. A decision control system is used in C to handle situations of this nature.</p>



<p>The decision control instruction is implemented in C using the if keyword, just like in any other programming language. The if statement&#8217;s condition is always encased in a pair of parentheses. The set of statements that follow the if statement will be executed if the condition is met. Additionally, the statement will not be executed if the condition evaluates to false; instead, the programme will skip the enclosing portion of code.</p>



<figure class="wp-block-image size-full is-resized"><img decoding="async" src="https://studentprojects.in/wp-content/uploads/2022/10/image-8.png" alt="" class="wp-image-9670" width="448" height="210" srcset="https://studentprojects.in/wp-content/uploads/2022/10/image-8.png 660w, https://studentprojects.in/wp-content/uploads/2022/10/image-8-300x141.png 300w" sizes="(max-width: 448px) 100vw, 448px" /></figure>



<p>If the expression after the if evaluates to true, the statement contained in the if block will be carried out. However, if the if block is followed by an else block, a sequence of statements in the else block will be executed when the if block&#8217;s condition is false.</p>



<p>The syntax for if-else statements is as follows:</p>



<pre class="wp-block-code"><code class="">if ( condition ){
statements;}
 else {
statements;}</code></pre>



<p>One scenario where the if-else phrase could be utilised is</p>



<pre class="wp-block-code"><code class="">#include &lt;stdio.h&gt;
int main()
{
    int num = 10;
    if (num &lt;= 10)
    {
        printf("Number is less than equal to 10.");
    }
    else
    {
        printf("Number is greater than 10.");
    }
    return 0;
}</code></pre>



<p>Output: Number is less than equal to 10.</p><p>The post <a href="https://studentprojects.in/software-development/c-tutorials/c-tutorials-c-tutorials/c-if-else-statements/">C if…else statements</a> first appeared on <a href="https://studentprojects.in">Student Projects</a>.</p>]]></content:encoded>
					
					<wfw:commentRss>https://studentprojects.in/software-development/c-tutorials/c-tutorials-c-tutorials/c-if-else-statements/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
